You are here:  » RSS feeds with images

Support Forum



RSS feeds with images

Submitted by shogounou on Wed, 2009-05-06 09:20 in

Hi David

I update my data each day with cron work.
I wonder if it is possible to include an rss feed with product images, working in IE and firefox ?
I think that others can be interested by this, so please thank you to post the code in this post if my request is possible.

Thank you

Best regards

Guillaume

Submitted by support on Wed, 2009-05-06 12:32

Hello Guillaume,

Creating an RSS feed is relatively straight forward - the following thread covers this..

http://www.pricetapestry.com/node/1110

...but it is more a question of what content you actually want in the feed. Bear in mind that when you import, all products are deleted first and then the new feed imported, so it's not really that straight forward to do a new products feed i'm afraid, but let me know what you had in mind and I'll look at what queries would be required to create the feed...

Cheers,
David.

Submitted by shogounou on Thu, 2009-05-14 07:50

Hi David

I launch a cron tab every night to update my database.
I would like to offer to customers the ability to syndicate to an Rss feed with the images of the products. I wish that this rss feed shows each last 10 imported products.

Can you help me please?

Thank you

Guillaume

Submitted by support on Thu, 2009-05-14 08:52

Hello Guillaume,

Unfortunately Price Tapestry does not have any information about the latest products to be imported. This is because the quickest (and easiest) way to update the database for a merchant is simply to DELETE all products and then INSERT the products latest feed, so the latest products as in those with the highest ID in the database would simply depend on the order of import rather than products actually being new.

Ultimately, there isn't really an ideal mapping between a large product database and RSS - it's not like news where a small number of articles are updated in chronological order...

Cheers,
David.

Submitted by shogounou on Thu, 2009-05-14 20:21

Okay thank you david

Is it possible to generate an rss feed with 10 random products and its image ?

Thank you in advance

Submitted by support on Fri, 2009-05-15 08:07

Hi,

Sure - using rss.php code from the RSS thread, replace the following line that queries the products:

$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE merchant='".database_safe($_GET["merchant"])."'";

...with:

$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` ORDER BY RAND() LIMIT 10";

As there is no native image support in RSS, all you can really do is embed the image HTML into the description field. To do this, replace the following line:

      print "<description><![CDATA[".$row["description"]."]]></description>";

..with:

      if ($row["image_url"])
      {
        print "<description><![CDATA[<img src='".$row["image_url."' />&nbsp;".$row["description"]."]]></description>";
      }
      else
      {
        print "<description><![CDATA[".$row["description"]."]]></description>";
      }

Cheers,
David.

Submitted by shogounou on Mon, 2009-05-18 14:45

Hi David

The rss.php works perfectly.

But When I syndicate, i only show the 10 random product of the feed when I syndicate.
How to make appear 10 randoms products for customer when he syndicates ?

Best regards

Submitted by support on Mon, 2009-05-18 17:41

Hello Guillaume,

I'm afraid I'm not sure what you mean - can you perhaps post or email me some example links where they are different and I will try to help...

Or in other words; to tell me the difference between you and your customer...

Thanks!

David.