Create RSS Feeds
A client wanted to me to create an RSS Feed of their event listings for syndication. I was able to create one in under a half hour using easyPHPCalendar. It requires a template file, and a php file to generate the feed using only a few lines of code. I'm not sure if this meet RSS standards but it works in Firefox live bookmarks and a few readers I checked.
Listing Template For the RSSFeed
rss.php
PHP Code:
<!--head--> <!--head--> <!--body--> <item> <title>[title]</title> <link>[url]http://www.domain.com/calendar.php#[/url][title]RSS Title Name</link> <description><![CDATA[[descr]]]></description> <dc:creator>EasyPHPCalendar</dc:creator> <dc:date>[date][time]</dc:date> </item> <!--body--> <!--foot--> <!--foot--> <!--empty--> <!--empty-->
The Actual RSS Feed
rssfeed.php
PHP Code:
<?php header("Content-type: text/xml");?> <?php echo "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">" ?> <channel> <title>EasyPHPCalendar</title> <link>http://www.domain.com/</link> <description>EasyPHPCalendar Events RSS Feed</description> <language>en-us</language> <?php $LIST=1; $DF = "M d"; $listMonths = 1; $noOld = 1; $template="rss.php"; require ("calendar/calendar.php"); ?> </channel> </rss>
Firefox Live Bookmarks Code
Insert into the head of the page you want the live bookmarks to appear.
HTML Code:
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.domain.com/rssfeed.php">
|