Hi David,
I was wondering if you thought it might be a good idea to include RSS feeds into Price Tapestry?
Everywhere I read these days seems to be the on the importance of RSS feeds.
If you did think it was a good idea, would they be most effective for merchants, brands or categories?
Thanks,
Simon,
I am working on a rss script which will produce xml feeds per merchant and all their products.
hi crounauer,
i tried the rss mod above but got this error.
Invalid at the top level of the document. Error processing resource
any update on this RSS mod?
thank you.
atman
heres the error script while using firefox.
XML Parsing Error: not well-formed
Location: http://example.com/rss.php
Line Number 4, Column 1:$sql = "SELECT * FROM `".$config_databaseTablePrefix."feeds` ORDER by merchant";
^
Hi atman,
The line $sql = ..... is outside of the PHP tags, so it will apear in the output and that is why the XML is therefore invalid.
I'm not familiar with the original script, but I think it should probably be something like this:
<?php
require("includes/common.php");
Header('Content-Type: application/xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
echo '<?xml-stylesheet href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"?>' . "\n";
echo '<!-- RSS for ' . $config_title . ', generated on ' . date(r) . ' -->' . "\n";
$sql = "SELECT * FROM `".$config_databaseTablePrefix."feeds` ORDER by merchant";
?>
<rss version="0.92">
<channel>
<title><?php echo $merchant; ?></title>
<link><?php echo $base_url;?></link>
<description><?php echo $store_desc; ?></description>
<webMaster><?php echo $email_address; ?></webMaster>
<language><?php echo $lang_code; ?></language>
<lastBuildDate><?php echo date(r); ?></lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<?php
if (database_querySelect($sql,$rows))
{
$sitemapBaseHREF = "http://".$_SERVER["HTTP_HOST"].$config_baseHREF;
foreach($rows as $row)
{
echo '<item>' . "\n";
echo ' <title>' , $row["merchant"] , '</title>' . "\n";
echo ' <link>' . $sitemapBaseHREF . "merchant/" . tapestry_hyphenate($row["merchant"])."/" . '</link>' . "\n";
echo ' <description>' , $row["merchant"] , '</description>' . "\n";
echo '</item>' . "\n";
}
}
?>
</channel>
</rss>
working now. thank you.
multiple rss channels
- recently updated products
- new reviews
- option to have everything on RSS. similar to wordpress, rss for categories, for merchants, for products, brands etc.
just a suggestion. :)
regards,
atman
Hi David,
I got this error when trying to use the rss.php. How to fix this.
Invalid xml declaration.
Line: 2 Character: 3
thanks
jack
Hello Jack,
Can you do a "View > Source" in your browser when opening the RSS feed and see if there are any spurious characters that are before the opening XML tag? Basically, there should be nothing at all before:
<?xml
Cheers,
David.
David,
I want to add some feeds to my site from merchants that do not provide anything but an RSS or XML feed. Will this routine help with that and how do I integrate it?
Thanx
Gene
Hello Gene,
This script is about exporting, not importing; so if you want to list merchants that do not provide an XML or RSS feed you will need to contact them (or the network) about providing a feed. If you have a merchant that provides an RSS feed remember that you can register and import it as normal - Price Tapestry reads RSS feeds no problem!
Cheers,
David.
I have come up with this script for RSS 0.92. It works but I don't recommend it for large stores as it takes a long time to load and can be quite intesive on your resources.
Simply add a file called rss.php to the root of your site!
<?php
require("includes/common.php");
Header('Content-Type: application/xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
echo '<?xml-stylesheet href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"?>' . "\n";
echo '<!-- RSS for ' . $config_title . ', generated on ' . date(r) . ' -->' . "\n";
?>
$sql = "SELECT * FROM `".$config_databaseTablePrefix."feeds` ORDER by merchant";
<rss version="0.92">
<channel>
<title><?php echo $merchant; ?></title>
<link><?php echo $base_url;?></link>
<description><?php echo $store_desc; ?></description>
<webMaster><?php echo $email_address; ?></webMaster>
<language><?php echo $lang_code; ?></language>
<lastBuildDate><?php echo date(r); ?></lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<?php
if (database_querySelect($sql,$rows))
{
$sitemapBaseHREF = "http://".$_SERVER["HTTP_HOST"].$config_baseHREF;
foreach($rows as $row)
{
echo '<item>' . "\n";
echo ' <title>' , $row["merchant"] , '</title>' . "\n";
echo ' <link>' . $sitemapBaseHREF . "merchant/" . tapestry_hyphenate($row["merchant"])."/" . '</link>' . "\n";
echo ' <description>' , $row["merchant"] , '</description>' . "\n";
echo '</item>' . "\n";
}
}
?>
</channel>
</rss>
Computer Hardware