Wednesday, 22 June 2016

How to create an RSS feed from URLs

How to create an RSS feed from URLs

Question: What is full form of RSS?
Rich Site Summary
Its also known as Really Simple Syndication.

Question: What is RSS feed?
It is standard web feed formats to publish the updated information of blog OR website.

Question: What is file extension of RSS Feed?
.xml or .rss

Question: Give a Sample of RSS Feeds?
Start the XML with following code.

<?xml version="1.0" encoding="utf-8"?>

        <item><title>RSS Title</title> <description>This is an RSS Description</description><link></link>http://www.example.com/url1<pubdate>Tue, 21 Jun 2016 15:36:00 +0000</pubdate></item>
        <item><title>RSS Title</title> <description>This is an RSS Description</description><link></link>http://www.example.com/url2<pubdate>Tue, 21 Jun 2016 20:36:00 +0000</pubdate></item>
        <item><title>RSS Title</title> <description>This is an RSS Description</description><link></link>http://www.example.com/url3<pubdate>Wed, 22 Jun 2016 01:36:00 +0000</pubdate></item>
        <item><title>RSS Title</title> <description>This is an RSS Description</description><link></link>http://www.example.com/url4<pubdate>Wed, 22 Jun 2016 06:36:00 +0000</pubdate></item>
Question: Create a script for?
Question: From where I can validate the RSS Feed URL?

Question: From where I can validate the RSS Feed Data?

Question: Give a script to generate rss feeds from URL?

$urls= array(

$dateTime=strtotime('Tue, 21 Jun 2016 10:36:00 +0000');
$siteMapXml = '<rss><channel>';
header("Content-type: application/xml");
header("Content-Disposition: attachment; filename=sitemap.xml");
header("Pragma: no-cache");
header("Expires: 0");
foreach($urls as $url){    
    $dateString=date('D, j M Y H:i:s +0000',$dateTime);
     $siteMapXml.="<item><title>Page Title</title> <description>Page Description</description><link></link>{$url}<pubdate>{$dateString}</pubdate></item>";   
echo $siteMapXml.='</channel></rss>';

No comments:

Post a Comment