You are here:  » RSS Feeds

Support Forum



RSS Feeds

Submitted by JasonG on Fri, 2011-12-09 10:22 in

Hi David

I know we have feed URL's which I have submitted to Googkle but an playing with a new feature and require RSS for each of the feeds

Any suggestions please

Thanks
Stuart

Submitted by support on Fri, 2011-12-09 10:35

Hi Stuart,

There's various export scripts and RSS export of subsets on the forum so it's reasonably straight forward to do - could you describe exactly what you require exported in RSS format (number / naming of files; and field contents for each item) and I'll tie up the various relevant posts for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by JasonG on Fri, 2011-12-09 12:23

Hi David

We wanted to add retailer feeds from PT to try this
{link saved}

Aparantly can add multiple RSS feeds

Hope that helps

Regards
Stuart

Submitted by support on Fri, 2011-12-09 12:45

Hi Stuart,

Here's a basic RSS export script, limited to 10 products for testing purposes - simply edit the LIMIT clause in the SQL at line 15 for more or less products. The generates a file products.rss for forced download;

<?php
  set_time_limit(0);
  require("includes/common.php");
  header("Content-Type: application/octet-stream");
  header("Content-Disposition: attachment; filename=products.rss");
  $baseHREF = "http://".$_SERVER["HTTP_HOST"].$config_baseHREF;
  print "<?xml version='1.0' ?>\n";
  print "<rss version='2.0'>\n";
  print "<channel>\n";
  print "<title>".$config_title."</title>\n";
  print "<link>".$baseHREF."</link>\n";
  $link = mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword);
  mysql_select_db($config_databaseName,$link);
  $sql = "SELECT * FROM `".$config_databaseTablePrefix."products` GROUP BY name LIMIT 10";
  $result = mysql_unbuffered_query($sql,$link);
  while($row = mysql_fetch_array($result,MYSQL_ASSOC))
  {
    if ($config_useRewrite)
    {
      $link = $baseHREF . "product/".tapestry_hyphenate($row["normalised_name"]).".html";
    }
    else
    {
      $link = $baseHREF . "products.php?q=".urlencode($row["normalised_name"]);
    }
    print "<item>\n";
    print "<title><![CDATA[".$row["name"]."]]></title>\n";
    print "<title><![CDATA[".$row["description"]."]]></title>\n";
    print "<link><![CDATA[".$link."]]></link>\n";
    print "</item>\n";
  }
  print "</channel>";
?>

Cheers,
David.
--
PriceTapestry.com