How I put XML news Feed in my static site ?

Discussion in 'PHP' started by expertwebdesigner, Nov 11, 2009.

  1. #1
    Hi,
    I have a static site. I want to put xml rss news feed in my site, Plz help me ...

    thank you
     
    expertwebdesigner, Nov 11, 2009 IP
  2. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #2
    RSS can be a static file too.
    Look at any rss feed like on this forum:
    
    <?xml version="1.0" encoding="UTF-8"?>
    
    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    	<channel>
    		<title>Digital Point Forums - PHP</title>
    		<link>http://forums.digitalpoint.com/</link>
    		<description>The most widely used server-side programming language for web applications.</description>
    		<language>en</language>
    
    		<lastBuildDate>Wed, 11 Nov 2009 16:25:06 GMT</lastBuildDate>
    		<generator>vBulletin</generator>
    		<ttl>5</ttl>
    		<image>
    			<url>http://forums.digitalpoint.com/images/misc/rss.jpg</url>
    			<title>Digital Point Forums - PHP</title>
    
    			<link>http://forums.digitalpoint.com/</link>
    		</image>
    		<item>
    			<title>How To Make PTC Script</title>
    			<link>http://forums.digitalpoint.com/showthread.php?t=1569239&amp;goto=newpost&amp;r=b613</link>
    			<pubDate>Wed, 11 Nov 2009 14:42:45 GMT</pubDate>
    
    			<description>Hello DP Users, I want to make a PTC script. Can any body help me in these regards ? Please give me any links to tutorials that help in making such script. 
     
    Thankyou :)</description>
    			<content:encoded><![CDATA[<div>Hello DP Users, I want to make a PTC script. Can any body help me in these regards ? Please give me any links to tutorials that help in making such script.<br />
    <br />
    Thankyou :)</div>
    
    ]]></content:encoded>
    			<category domain="http://forums.digitalpoint.com/forumdisplay.php?f=37">PHP</category>
    			<dc:creator>ghazal</dc:creator>
    			<guid isPermaLink="true">http://forums.digitalpoint.com/showthread.php?t=1569239</guid>
    		</item>
    </channel>
    </rss>
    
    HTML:
    http://forums.digitalpoint.com/external.php?type=RSS2&forumids=37
    So you can make such a file in any text editor and upload it to your site.
    Then place a link in your head html section like this one:
    
    <link rel="alternate" type="application/rss+xml" title="Digital Point Forums - PHP - RSS Feed" href="external.php?type=RSS2&amp;forumids=37" />
    
    HTML:
    Your RSS feed is ready.
     
    AsHinE, Nov 11, 2009 IP