Google Base RSS Feed

Contrib type: 
Module
Status: 
Initial upload

Downloads

Compatibility: 
Ubercart 1.x

This 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.xml

After 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!


PreviewAttachmentSize
uc_google_base.tar.gz1.66 KB
Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6855
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.

jhuckabee's picture
Offline
Uber Donor
Joined: 08/13/2007
Juice: 45
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.

baalsgate's picture
Offline
Joined: 09/12/2007
Juice: 50
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 Smiling

thanks .

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
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.

--
Help directly fund development: Donate via PayPal!

yoeff's picture
Offline
Joined: 07/02/2008
Juice: 40
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>';
}
yoeff's picture
Offline
Joined: 07/02/2008
Juice: 40
fixed module file

Here is a copy of the module file that has the fixes talked about so far.

AttachmentSize
uc_google_base.zip 1.34 KB
dgitman's picture
Offline
Joined: 07/22/2008
Juice: 16
Re: Google Base RSS Feed Problems

Here's an updated module with baalsgate fixes and the XML formatted.

AttachmentSize
uc_google_base.zip 1.34 KB
benepiccc's picture
Offline
Joined: 08/16/2008
Juice: 23
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

schaub123's picture
Offline
Bug FinderGetting busy with the Ubercode.PayPal Hero
Joined: 10/08/2007
Juice: 458
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.

Christopher Schaub

c0psrul3's picture
Offline
Joined: 10/07/2007
Juice: 95
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'),"

AttachmentSize
uc_google_base.zip 4.85 KB
schaub123's picture
Offline
Bug FinderGetting busy with the Ubercode.PayPal Hero
Joined: 10/08/2007
Juice: 458
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.

Christopher Schaub

goodeit's picture
Offline
Joined: 05/28/2008
Juice: 323
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

c0psrul3's picture
Offline
Joined: 10/07/2007
Juice: 95
i use it

has brought products into google base wonderfully for me Smiling
email me if you want to talk about specifics.

smokris's picture
Offline
Joined: 11/30/2008
Juice: 14
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.

AttachmentSize
uc_google_base-20081130.tar.gz 1.47 KB
bhallnc's picture
Offline
Joined: 03/23/2009
Juice: 81
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.

imstillatwork's picture
Offline
Bug Finder
Joined: 12/27/2008
Juice: 207
Re: Update?

I am also looking for UC 2 Google Products module too, very much needed in fact!

jlaster's picture
Offline
Joined: 03/08/2009
Juice: 22
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.

schaub123's picture
Offline
Bug FinderGetting busy with the Ubercode.PayPal Hero
Joined: 10/08/2007
Juice: 458
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.

Christopher Schaub

jazzdrive3's picture
Offline
Joined: 03/29/2009
Juice: 221
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!

Insurrectus's picture
Offline
Spreading the word - Ubercart for president.
Joined: 08/22/2007
Juice: 364
Add a Condition Attribute

Any plans to add the condition attribute. Google will start requiring this 6/30/2009.

unrev.org's picture
Offline
Joined: 02/20/2009
Juice: 41
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!

NecroHill's picture
Offline
Joined: 08/12/2008
Juice: 111
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

AttachmentSize
uc_google_base.zip 1.74 KB
danbaker's picture
Offline
Joined: 06/20/2009
Juice: 9
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

AttachmentSize
uc_google_base_V_2.1.zip 1.79 KB
danbaker's picture
Offline
Joined: 06/20/2009
Juice: 9
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.

AttachmentSize
uc_google_base_2_2.zip 2.68 KB
unrev.org's picture
Offline
Joined: 02/20/2009
Juice: 41
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!

unrev.org's picture
Offline
Joined: 02/20/2009
Juice: 41
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)

AttachmentSize
uc_google_base-d5-uc1.7.zip 1.85 KB
schaub123's picture
Offline
Bug FinderGetting busy with the Ubercode.PayPal Hero
Joined: 10/08/2007
Juice: 458
Official Project in CVS?

Is there a way we can get this checked into CVS, both the 5 and 6 versions?

Christopher Schaub

LightFromArt's picture
Offline
Joined: 08/28/2009
Juice: 28
Re: Google Base V 2.2

I am new in ubercart community.
I implemented my initial version of website based on Drupal6.
It works great. The only thing that I am making to work is google base feed.
The file was not created.
Should I run some command to create it, or should I create an empty file
by hand in advance?
I am using the following:

Google Base Feed Version 2.3.1
Drupal 6.13, Ubercart 2.rc6
I have done the following set up store admin -> configuration -> Google Base Feed:
Feed Title:My Google Base RSS Feed
Feed Title:My Google Base RSS Feed Description
Feed Link: http://mysitename.com/drupal/products/google_base.xml (I put my real site name instead of mystename)
I also installed and enable recommended module:
poormanscron-6.x-1.0
Thank you in advance for any suggestions.

LightFromArt's picture
Offline
Joined: 08/28/2009
Juice: 28
some data is missing

I checked your site:
http://www.reputabletech.com/products/google_base.xml.
Looks good and each product have title, description and link to the product.
What do you think, may be your file should have the following parameters required
by google base:
sale price, image, location, condition, weight,....
Thank you c0psrul3 for your help. Now I could generate google_base.xml too.
I tried to create google-base.xml for my site using
Google Base Feed Version 2.3.1
Drupal 6.13, Ubercart 2.rc6
and got the same problem, some required parameters are missing.
Any suggestions?

tjay12's picture
Offline
Joined: 11/03/2009
Juice: 7
images not showing up on my google base products

Hi, I am using the latest version of Google base module on my website. Everything worked except images are missing on Google. Here is the link to my xml file:
http://www.fireplacelane.com/products/google_base.xml

also google is rejecting many products giving error that invalid characters in the description. How do I remove html tags when I download the file using curl. Thanks.

mkansagarfa's picture
Offline
Joined: 11/12/2009
Juice: 2
Regarding Product Type In Google Base API

Hi!!!

I have a job that has been fired on every month I am adding my products to google merchant center. Now I have 2 Problems in it. I have free shipping products and I am using API to upload Item Then How I Can Define Whether The Product has free shipping or not and One More thing is that I want to Specify Product Type I already Specify Item Type = "Products"
but in account setting it shows the Product Type as missing attributes how can i perform this. please help me regarding this.

Regards,
Milind Kansagara

Von Gunther's picture
Offline
Joined: 07/16/2010
Juice: 106
NEW UPTODATE MODULE

A New And Well Featured Module Has Been Publised Here : http://www.ubercart.org/project/uc_website_xml

RSS Feeds for google base and others plus sitemap.

cookiesunshinex's picture
Offline
Joined: 10/14/2009
Juice: 127
Update with new Google Base requirements?

I've just received this email from Google and I'm wondering if this module is going to be updated to accommodate the changes, or whether they are necessary.

Thank you for participating in Google Product Search. We are reaching out to you to inform you about important changes we’re making to our Product Search attribute requirements for unique identifiers and tax and shipping information.

Starting May 3rd, 2011, we’ll require your product listings to include at least two of the three unique identifiers (Brand, MPN, GTIN). In order to provide as much information as possible to our users, we need your help in matching your products to our "product pages", where users are able to view useful data such as product specifications or reviews. While these attributes will not be required for your data feed to process correctly, they may prevent your items from appearing in Product Search results if not included. For more details, including what specific identifiers you should include for each category of item, please see our Help Center at http://www.google.com/support/merchants/bin/answer.py?answer=160161

Starting June 6th, 2011, we’ll also require your product listings to include tax and shipping information to provide buyers with important price information. This information will be required at either the account or item level (in the “tax” or “shipping” attribute) in order for your items to process and appear in Google Product Search results. For instructions on how to include tax and shipping information, please visit http://www.google.com/support/merchants/bin/answer.py?hl=en&answer=160162

cookiesunshinex's picture
Offline
Joined: 10/14/2009
Juice: 127
Drupal.org project?

Is it possible to create a Drupal.org project for this module?

That way this module can be updated via Drush and we can be notified that there are updates available through the Available Updates mechanism that is now in Drupal 6.x

cookiesunshinex's picture
Offline
Joined: 10/14/2009
Juice: 127
Update with new Google Base requirements?

I received the following letter from Google within the past couple of days. Does this project need to be updated to accomodate google's changes?

Thank you for participating in Google Product Search. We are reaching out to you to inform you about important changes we’re making to our Product Search attribute requirements for unique identifiers and tax and shipping information.

Starting May 3rd, 2011, we’ll require your product listings to include at least two of the three unique identifiers (Brand, MPN, GTIN). In order to provide as much information as possible to our users, we need your help in matching your products to our "product pages", where users are able to view useful data such as product specifications or reviews. While these attributes will not be required for your data feed to process correctly, they may prevent your items from appearing in Product Search results if not included. For more details, including what specific identifiers you should include for each category of item, please see our Help Center at http://www.google.com/support/merchants/bin/answer.py?answer=160161

Starting June 6th, 2011, we’ll also require your product listings to include tax and shipping information to provide buyers with important price information. This information will be required at either the account or item level (in the “tax” or “shipping” attribute) in order for your items to process and appear in Google Product Search results. For instructions on how to include tax and shipping information, please visit http://www.google.com/support/merchants/bin/answer.py?hl=en&answer=160162