Contrib type:
ModuleStatus:
Initial uploadSponsored by:
Josh HuckabeeCompatibility:
Ubercart Alpha 8This module create a very basic Google Base RSS feed that can be used to upload the products in your Ubercart store to Google Base via the bulk upload feature.
This is not an integration with the Google Base API. This module create a path to an RSS feed at yourdomain.com/products/google_base.xml which you can download and then upload to Google Base via their bulk upload function.
The module allows you to define the title, description, and link used in the header of the feed via admin/store/settings/google_base.
You can download the file using the following command:
curl -O http://yourdomain.com/products/google_base.xmlAfter you've downloaded the file, login to your Google Base account and upload the google_base.xml file using the bulk upload function.
Comments, suggestions, improvements welcome!
Related threads:
| Attachment | Size |
|---|---|
| uc_google_base.tar.gz | 1.66 KB |



Re: Google Base RSS Feed
Won't you be able to navigate to that page with your browser? If you can, then you can just save the page to get the file.
In the same vein, does Google Base allow you to post the URL to the feed? It's been a while, so I don't remember all the differences between the various feed readers.
Re: Re: Google Base RSS Feed
You are right Lyle. I have firefox setup to automatically subscribe to RSS feeds in Mail on Leopard, so I get my feed subscription pop-up instead of the actual page.
I know Google Base doesn't allow you to post the URL to the feed from its UI. You have to actually register the file first, and then you can upload it. Also, your uploaded filename must match the registered file name.
Oh, and you can also FTP your file up. But that requires you save it locally first as well.
Google Base RSS Feed Problems
The idea is great so im giving it a go thanks for your hard work .
OK initaily I have had a few problems such as
Link tag data missing the full path , i fixed this by changing
$output .= '' . $GLOBALS['base_url'] . $product->path . '';
to
$output .= '' . $GLOBALS['base_url'] . '/' . $product->path . '';
Seemed to be a slash missing there .
ok then some more testing I found that the image_link was also wrong
producing
http://www.mysite.com/203954532.jpg
instead of
http://www.mysite.com/files/203954532.jpg
I narrowed that down to changing this line :
if (isset($product->field_image_cache) && file_exists($product->field_image_cache[0]['filepath'])){
$output .= '' . $GLOBALS['base_url'] .'/'. rawurlencode(basename($product->field_image_cache[0]['filepath']))
to
if (isset($product->field_image_cache) && file_exists($product->field_image_cache[0]['filepath'])){
$output .= '' . $GLOBALS['base_url'] .'/'. ($product->field_image_cache[0]['filepath'])
Now im not sure why the "rawurlencode(basename" was in there but it removes "/files" and breaks the url .
I have PATHAUTO installed im not sure if that is part of the issue or not .
I am posting this as maybe it fixes a bug or at least brings some attention to an issue .
I hope it may help someone else having problems , I had problems at first getting the XML file saved as clean XML with firefox i had to view source and then save as the automatic RSS feed in firefox adds some JAVA to the page, and that kind of messes it up.
I may work on improving this a bit more with refining the information that gets put in the output , but thats for another day when I have learned more
thanks .
Re: Google Base RSS Feed Problems
I'd probably swap out the $GLOBAL['base_url'] variable and use base_path() instead. That will output the leading slash for you, too.
Path problem
I didn't use autopath so here is a fix for products with out a path.
if (!empty($product->path)){$output .= '<link>' . base_path() . $product->path . '</link>';
} else{
$output .= '<link>' . base_path() . 'node/' . $product->nid . '</link>';
}
fixed module file
Here is a copy of the module file that has the fixes talked about so far.
Re: Google Base RSS Feed Problems
Here's an updated module with baalsgate fixes and the XML formatted.
Re: Google Base RSS Feed
Tried to implement this (thank by the way!!) and I'm having a problem with images that have spaces in their name:
http://epic-cc.com/files/T&A tour shirt.jpg
and points to the first space as the cause.
I'm new to all of this so i'm not too sure on how to fix this, any idea?
full error page:
XML Parsing Error: not well-formed
Location: http://epic-cc.com/products/google_base.xml
Line Number 932, Column 43:http://epic-cc.com/files/T&A tour shirt.jpg
------------------------------------------^
Or you can view by going to:
http://epic-cc.com/products/google_base.xml
Re: Google Base RSS Feed
I'm thinking it would probably be a good idea to wrap all text fields with htmlentities() -- any ampersands or quotes will break the XML.
Does anybody think this should be submitted as an actual contrib module for ubercart? Is anybody using this code?
Thanks for the initial work.
6.x port
here's my working ported version of this module.
i'm submitting this for testing and moderation, but it looks good to me.
comments welcome
FIX: messed up the _menu hooks fergot the "array('access content'),"
Re: Google Base RSS Feed
Does anyone have a clue why the "upload" works for google base, but the data feed does not? The data feed allows you to point to a url and schedule google to upload it. It should be the same, but is not? I can get google to upload the google_base.xml, but only manually. Want to run it daily so google picks up product changes etc.
Re: Google Base RSS Feed
I've been looking over dgitman's version of this module, and while I haven't actually tried it yet, I was wondering why you used <guid> instead of <g:id> to uniquely identify each product. I know <guid> is used by rss, but google specifies <g:id> for the unique field.
Also, what's the best way to separate the manufacturer's taxonomy from the "product type" taxonomy so that terms from the manufacturer vocab do not get submitted in product type:
$output .= "<g:product_type>" . check_plain(implode(',', $terms)) . "</g:product_type>\n";Does anyone else use this module? Is there a more current version than the one I am using?
Thanks
i use it
has brought products into google base wonderfully for me
email me if you want to talk about specifics.