Please inform me
RSS Feeds
How do you do it?
Page 1 of 1
RSS Feeds How do you do it?
#1
Posted 03 August 2007 - 06:09 AM
Hi.. I'm not sure if this is the right forum for this question, but is there a way to add an RSS feed directly to your site, with a page created by your self without going through one of those 'free-dowload-code' sites or widget sites? I only ask because, I was wondering whether this would make the rss feeds dowload any faster.
Please inform me
Please inform me
#2
Posted 03 August 2007 - 06:13 AM
This article is lengthy, but explains it all very well: http://searchenginew...ml?page=2175271
#5
Posted 07 September 2007 - 04:20 PM
For your edification, here's how I do it on one of my sites (with PHP):
Easy as pie.
$get_latest = $db->query("SELECT * FROM spoems ORDER BY sub_time DESC LIMIT 0, 10");
if ($get_latest->num_rows > 0) {
echo '<?xml version="1.0"?>' . $config['eol'];
echo '<rss version="2.0">' . $config['eol'];
echo ' <channel>' . $config['eol'];
echo ' <title>Spoetic.com RSS</title>' . $config['eol'];
echo ' <link>http://spoetic.com</link>' . $config['eol'];
echo ' <description>RSS feed of the most recent spoems posted on Spoetic.com.</description>' . $config['eol'];
echo ' <language>en-us</language>' . $config['eol'];
$i = 0;
while ($row = $get_latest->fetch_assoc()) {
$pub_date = date('D, d M Y H:i:s', strtotime($row['sub_time']));
if ($i < 1)
{
echo ' <pubDate>' . $pub_date . '</pubDate>' . $config['eol'];
}
echo ' <item>' . $config['eol'];
echo ' <title>Spoem #' . $row['id'] . '</title>' . $config['eol'];
echo ' <link>http://spoetic.com/view/' . $row['id'] . '/</link>' . $config['eol'];
echo ' <description><![CDATA[' . $row['spoem'] . ']]></description>' . $config['eol'];
echo ' <pubDate>' . $pub_date . '</pubDate>' . $config['eol'];
echo ' </item>' . $config['eol'];
$i++;
}
echo ' </channel>' . $config['eol'];
echo '</rss>' . $config['eol'];
}
Easy as pie.
This post has been edited by pgoneill: 07 September 2007 - 04:21 PM
#6
Posted 12 September 2007 - 09:16 AM
Thanks, that was useful. For future reference. Cheers!
Share this topic:
Page 1 of 1


Help
This topic is locked

MultiQuote










