Create An RSS Feed For Your Site
RSS feeds for your
content are very important these days. A large number of people stay
updated using RSS readers which pull in updates from the sites
subscribed. In addition, RSS feeds can be used in a number of ways to
promote your content using social media.
An RSS feed for your site is essentially an XML file. You must adhere to a specific format for the XML file (as we shall see) for it to be identified as an RSS feed.
Let’s first have a look at how to create an RSS feed for your site from scratch.
All you have to do is to specify your information for all the necessary tags. You can use any text editor. Notepad would work fine but have a look at Notepad++. Let’s see what each of them mean. To create an RSS feed, you start off the RSS file as follows:
Next
up we have the actual content of the RSS feed that will be displayed as
distinct entries when viewed using a feed reader. Each entry is
contained within a pair of <item></item> and must have the
following content at least:
The data has a specific format, refer above, the time must be in GMT, you can also refer to RFC 822 section 5 for more details on other date-time specification format. Finally the description tag houses the actual content or description of the entry. Remember the above would be repeated for every entry on your website. For example if you have a blog with 5 articles, a complete RSS feed should have 5 item tags to house 5 entries.
Close off the open channel and rss tags and save the file. Upload it to the appropriate location on your web server (the site root would work fine) and you have an RSS file at your disposal.
source: makeuseof.com/tag/how-to-create-an-rss-feed-for-your-site-from-scratch
An RSS feed for your site is essentially an XML file. You must adhere to a specific format for the XML file (as we shall see) for it to be identified as an RSS feed.
Let’s first have a look at how to create an RSS feed for your site from scratch.
All you have to do is to specify your information for all the necessary tags. You can use any text editor. Notepad would work fine but have a look at Notepad++. Let’s see what each of them mean. To create an RSS feed, you start off the RSS file as follows:
<?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel>The first two lines specify the XML and RSS version as you can see. The third line opens a “channel” tag. This is what would contain all the information for your channel or website. Add these three lines as they are.
<title>MakeUseOf RSS Feed</title> <link>http://www.makeuseof.com/</link> <description>Cool Websites, Software and Internet Tips</description>Those few lines specify information about your RSS feed and your website. The title tag houses any title that you would like to give to your RSS feed, link tag points to your website, description tag contains a brief introduction about the RSS feed or the website. Whatever is inside your file now, lets call it the HEADER
<item> <title>Entry Title</title> <link>Link to the entry</link> <guid>http://example.com/item/123</guid> <pubDate>Sat, 9 Jan 2010 16:23:41 GMT</pubDate> <description>[CDATA[ This is the description. ]]</description> </item>Again the title tag would refer to the heading or your content, link is the complete web address at which the entry can be reached on your website, guid is a unique identifier for the entry. Since all of your entries would be located at a different URL, you can use the link as the guid (if of course no two entries would point to the same URL in your setup). pubDate houses the date on which the entry was published.
The data has a specific format, refer above, the time must be in GMT, you can also refer to RFC 822 section 5 for more details on other date-time specification format. Finally the description tag houses the actual content or description of the entry. Remember the above would be repeated for every entry on your website. For example if you have a blog with 5 articles, a complete RSS feed should have 5 item tags to house 5 entries.
Close off the open channel and rss tags and save the file. Upload it to the appropriate location on your web server (the site root would work fine) and you have an RSS file at your disposal.
source: makeuseof.com/tag/how-to-create-an-rss-feed-for-your-site-from-scratch
0 comments:
Post a Comment