cynosure1023 Posted May 26, 2011 Share Posted May 26, 2011 Hi Guys/Gals, I am kind of all new to this. We have a website and i was wondering if its possible to put a link for RSS feed. I tried to search in google but got kind of confused, as there are topics on how to create RSS Feeds I would really appreciate any help. Thanks in advance. Link to comment Share on other sites More sharing options...
Sl0G Posted May 26, 2011 Share Posted May 26, 2011 I believe that this is what you are looking for.http://www.w3schools.com/php/php_ajax_rss_reader.asp Link to comment Share on other sites More sharing options...
cynosure1023 Posted May 26, 2011 Author Share Posted May 26, 2011 I believe that this is what you are looking for.http://www.w3schools.com/php/php_ajax_rss_reader.asp Tnx Sl0G. I tried the above and it doesn't seems to be working. i will put the codes here may be wht i did: <form><select onchange="showRSS(this.value)"><option value="">Select an RSS-feed:</option><option value="IT Workplace">IT Workplace</option></select></form><br /><div id="rssOutput">RSS-feed will be listed here...</div> Then i create a .php page and called it as "getrss.php": <?php//get the q parameter from URL$q=$_GET["q"];//find out which feed was selectedif($q=="IT Workplace") { $xml=("http://st1main.wdf.sap.corp:8063/it-workplace-teamrss?vault=00008483"); }$xmlDoc = new DOMDocument();$xmlDoc->load($xml);//get elements from "<channel>"$channel=$xmlDoc->getElementsByTagName('channel')->item(0);$channel_title = $channel->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue;$channel_link = $channel->getElementsByTagName('link')->item(0)->childNodes->item(0)->nodeValue;$channel_desc = $channel->getElementsByTagName('description')->item(0)->childNodes->item(0)->nodeValue;//output elements from "<channel>"echo("<p><a href='" . $channel_link . "'>" . $channel_title . "</a>");echo("<br />");echo($channel_desc . "</p>");//get and output "<item>" elements$x=$xmlDoc->getElementsByTagName('item');for ($i=0; $i<=2; $i++) { $item_title=$x->item($i)->getElementsByTagName('title') ->item(0)->childNodes->item(0)->nodeValue; $item_link=$x->item($i)->getElementsByTagName('link') ->item(0)->childNodes->item(0)->nodeValue; $item_desc=$x->item($i)->getElementsByTagName('description') ->item(0)->childNodes->item(0)->nodeValue; echo ("<p><a href='" . $item_link . "'>" . $item_title . "</a>"); echo ("<br />"); echo ($item_desc . "</p>"); }?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.