Contrib type:
ModuleStatus:
Initial uploadSponsored by:
Josh HuckabeeCompatibility:
Ubercart 1.xThis 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.
Fix for sites using revision control
I recently started using this module --- to reply to lutegrass's comment above, yes, I think this should be submitted as an actual contrib module.
I've enabled revision control for products on my site, and the previous version of uc_google_base was incorrectly showing a feed entry for every revision of each product. I corrected the SQL join so that each item is only shown once.
This version also fixes the "Feed Description" admin settings field title.
Update?
Does anybody have this working for Drupal 6 and Ubercart 2? I tried the latest 2 files and neither are working. Have searched through the forum without success so please forgive me if this is covered elsewhere.
Re: Update?
I am also looking for UC 2 Google Products module too, very much needed in fact!
Creating google base feed with Views 2?
Hi,
Views 2 has a feed display that creates rss feeds. I was thinking that rather than integrating the google api (which looks like a whole mess) we could try creating a google base display for Views 2.
I am not familiar with the views API, but if somebody points me out in the right direction I can start researching how to create the google base display type for Views 2.
Re: Creating google base feed with Views 2?
You can create a feed style plugin for views2 (look in views directory and you'll see some already there including rss). You could also just create a regular view and use theme formatters in your theme directory:
http://views2.logrus.com/doc/html/group__views__templates.html
A plugin that would extend views and add a style option for an Feed display would be great.
Images
I'm not seeing any information whatsoever regarding images in the feed. Am I missing something? Is there something I need to configure?
Plus, when I tried to upload it, it said Failure: Data feed upload failed. No items are live.
Thanks!
Add a Condition Attribute
Any plans to add the condition attribute. Google will start requiring this 6/30/2009.
Indeed, was working and now is not!
I believe it has to do with the newly required Condition Attribute that is mentioned above.
Anyone patched/updated this and got it working yet?
Thanks!
please check out 6.x updated edition
I added condition field (its "new" for all products) and fixed menu bug, please check it out
maybe its a time to post it to drupal.org?
have no idea how to do this
A couple of updates.
I noticed that this module was posting the list price, instead of the "sell price."
The other issue, is that it links back to your website, not to the individual item.
Because my system is having issues with it's temp files, I can't currently post the original code, so i'll post my changes only:
Tell google how much we're selling it for, not the MSRP.
$output .= "" . $product->sell_price . "\n";
Tell google the exact URL for the individual item. So instead of being directed to mysite.com, they're sent to mysite.com/node/(node ID).
$output .= "" . $GLOBALS['base_url'] . '/node/' . $product->nid . "\n";
Check out the live version:
http://www.reputabletech.com/products/google_base.xml
Google Base Feed Version 2.1
Drupal 6.x, Ubercart 2.x
Google Base V 2.2
After sucessfully uploading all my products, google notified me that it would be beneficial to list the product weight. So I added some code that would do just that. I also added a readme.txt file to track any version changes that someone may do in the future.
Any chance of a fix for Drupal 5.x and UC 1.7?
Many thanks, danbaker, for the fix on the Drupal 6/UC 2 Google Base Feed module.
Is there any chance that you or anyone else has fixed this issue on Drupal 5.x with UC 1.7?
If not, I would be willing to pay a bounty for this to be fixed on one of my sites, and then contribute the resulting module here for folks needing to make it work with UC 1.7.
Any takers? (That already have Google Base and can test it out, naturally.)
Thanks a lot - much appreciated, it's such a stellar module!
Here is an update for Drupal 5/Ubercart 1.7!
In response to a post I made in the Drupal work forums (see below for link), Drupal user piggom was able to update the module found on this page for Drupal 5 and Ubercart 1.7 users!
I have attached the module to this comment. This has been tested on Arkadian Collection's website:
http://www.arkadiancollection.com
Many thanks to piggom for his quick work, excellent response time and professionalism.
Links -->
http://drupal.org/node/505816 (work forum post requesting update)
http://drupal.org/user/528130 (piggom's profile on Drupal)
http://www.ubercart.org/site/9202 (Arkadian Collection's Live Site release on Ubercart.org)