Saturday, 22 June 2019

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"?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0">
    <channel>
 <title>Web Technology experts Notes</title>
  <link></link>http://web-technology-experts-notes.in
  <description>We are Web Technology Experts Team who provide you Important information on Web Development</description>
        <item><title>How to create folder with extension like .EBextensions</title> <description>Suppose you want to create folder with name ".EBextensions" Create folder with name ".EBextensions." Press enter You will see "." will disapper automatically from end of string Folder with name ".EBextensions" created successfully.</description><link></link>http://www.web-technology-experts-notes.in/2016/12/how-to-create-folder-with-extension-like-ebextensions.html<pubdate>Tue, 21 Jun 2016 15:36:00 +0000</pubdate><media:thumbnail height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWxGQGHkE2lgyXWpEN-LW9mN1MrHB2ldKSvZX-Xn2ZlAh2Zqv33Saw1_sjYdq7i0N4XPzQ6ufeh8JXw6h2ER9sFqLYyXWMUNcJU7suHXO3bgb7EwMdCaRj7yn-hMVfw5VncU7H3gkryBQ1/s72-c/How+to+create+folder+with+extension.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"></media:thumbnail></item>
        <item><title>FCM push notification example</title> <description>Question: What is FCM Messages? Full form of FCM is Firebase Cloud Messaging. FCM is a cross-platform messaging solution that lets you reliably deliver messages to android and IOS devices at no cost. </description><link></link>http://www.web-technology-experts-notes.in/2016/12/fcm-push-notification-example.html<pubdate>Tue, 21 Jun 2016 20:36:00 +0000</pubdate><media:thumbnail height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJjl1lCoOWux0EG3hYYW1-rJqB-3iJsLaqIK-zOTjD_2Z_sq9v29LsVY9iC3lfu-6LZLD2TNQOahaajIsOP2y-HSQRGhUoe18L5LnJBHTU0ekF_6nVQMwSrYrkaeAJHYhFFkcds6FHEb6m/s72-c/FCM+push+notification+example.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"></media:thumbnail></item>
        <item><title>What are special characters? and how to remove special characters?</title> <description>Question: What are special characters? Special characters are selected punctuation characters present on standard US keyboard. Question: Provide list of special characters?</description><link></link>http://www.web-technology-experts-notes.in/2016/12/what-are-special-characters-and-how-to-remove-special-characters.html<pubdate>Wed, 22 Jun 2016 01:36:00 +0000</pubdate><media:thumbnail height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJjl1lCoOWux0EG3hYYW1-rJqB-3iJsLaqIK-zOTjD_2Z_sq9v29LsVY9iC3lfu-6LZLD2TNQOahaajIsOP2y-HSQRGhUoe18L5LnJBHTU0ekF_6nVQMwSrYrkaeAJHYhFFkcds6FHEb6m/s72-c/FCM+push+notification+example.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"></media:thumbnail></item>
        <item><title>Node JS tutorial for beginner</title> <description>Question: What is NodeJS Node.js is a platform built for fast and scalable network applications. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.</description><link></link>http://www.example.com/url4http://www.web-technology-experts-notes.in/2016/12/node-js-tutorial-for-beginner.html<pubdate>Wed, 22 Jun 2016 06:36:00 +0000</pubdate><media:thumbnail height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7anpECNis2R4U7MyWdWUbi9ygJyKA211ydgESbcWUPGgG3acZwMO4vAKe5MxE53DkFdTOMVPVe8AH76piiHPtCo2YmgVrbI4cabzc7lX1slYKhMOHNDi1oWtvTI4B6bz6qsXQVh-sJL-f/s72-c/What+are+special+characters+and+how+to+remove+special+characters.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"></media:thumbnail></item>
    </channel>
</rss>
Question: Create a script for?
Question: From where I can validate the RSS Feed URL?
https://validator.w3.org/feed/


Question: From where I can validate the RSS Feed Data?
https://validator.w3.org/feed/#validate_by_input


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


$urls= array(
    'http://www.web-technology-experts-notes.in/2016/12/how-to-create-folder-with-extension-like-ebextensions.html',
    'http://www.web-technology-experts-notes.in/2016/12/fcm-push-notification-example.html',
    'http://www.web-technology-experts-notes.in/2016/12/what-are-special-characters-and-how-to-remove-special-characters.html',
    'http://www.web-technology-experts-notes.in/2016/12/node-js-tutorial-for-beginner.html',
    );

$dateTime=strtotime('Tue, 21 Jun 2016 10:36:00 +0000');
$siteMapXml = '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0"><channel>';

//Uncomment the below code to enable download
/*header("Content-type: application/xml");
header("Content-Disposition: attachment; filename=rss.xml");
header("Pragma: no-cache");
header("Expires: 0");*/
$siteMapXml.=' <title>Web Technology experts Notes</title>
  <link></link>http://web-technology-experts-notes.in
  <description>We are Web Technology Experts Team who provide you Important information on Web Development</description>';
foreach($urls as $url){    
    $dateTime+=(3600*5);
    $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><media:thumbnail height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWxGQGHkE2lgyXWpEN-LW9mN1MrHB2ldKSvZX-Xn2ZlAh2Zqv33Saw1_sjYdq7i0N4XPzQ6ufeh8JXw6h2ER9sFqLYyXWMUNcJU7suHXO3bgb7EwMdCaRj7yn-hMVfw5VncU7H3gkryBQ1/s72-c/How+to+create+folder+with+extension.png" width="72" xmlns:media="http://search.yahoo.com/mrss/"></media:thumbnail></item>";   
}
echo $siteMapXml.='</channel></rss>';


Question: Give the Sample URL of RSS
Download Sample RSS