150 likes | 292 Views
Creating an RSS 2.0 Feed. Azeem Ahmad. Step 1 - Declaration. RSS 2.0 must validate as XML (Extensible Markup Language), therefore the first line in the feed has to be a declaration of this: <?xml version="1.0"> You can also add encoding to the start to improve the feed:
E N D
Creating an RSS 2.0 Feed Azeem Ahmad
Step 1 - Declaration • RSS 2.0 must validate as XML (Extensible Markup Language), therefore the first line in the feed has to be a declaration of this: • <?xml version="1.0"> • You can also add encoding to the start to improve the feed: • <?xml version="1.0" encoding="utf-8"?> • Most types of encoding will work
Step 2 – RSS Channel • We now need to create an RSS and CHANNEL tag, so all the content/information can go inside these tags. • <rss version="2.0"> <channel> • Stick to lower case where relevant. • Just like HTML, mixing cases can confuse things!
Step 3 – Feed Information • The technical, and tricky bit of RSS – getting this wrong can make the feed invalid and it wont work properly. • In this step, we need to include: • The title of the website we’re creating the feed for • A brief, one line description of the site • A link to the site! • It will look something like..
Step 3 – Feed Information • <title>The title of my RSS 2.0 Feed</title> <link>http://www.azisalegend.com/</link><description>A website about the legend that is known as Azeem!</description><language>en-uk</language> • Also possible to add the time the site was last updated, but doing so may cause issues for maintenance of the feed, and may not make the feed work.
Step 4 – Adding more info • A method that allows you to add more pages to the feed. • Each item has a title, link, and description. • If you included the time in the previous step, you will need to include a publication date, and a guid. • A guid is a Globally Unique Identifier: • That’s why RSS is so complicated nowadays. • So, here’s how that part of the feed will look:
Step 4 – Adding more info • <item> <title>Title of an item</title><link>http://azisalegend.com/howididit</link><description>How Az became a legend</description> </item>
Step 5 – Checking the code • ‘Escaping’ – RSS developers use this term to describe the process of closing any open tags in the code. • Example: • <link>http://www.google.com<link> • Above link wont work, because it isn’t closed. • <link>http://www.google.com</link> • Above link now works because its closed.
Step 6 – Close The Tags • Once all information is inside the feed, we now need to close the opening tags – similar to designing a webpage. • </channel> </rss> • LIFO – Last In, First Out • This is the easy bit of RSS • (If there is one)
Step 7 – Validating The Feed • Can’t just upload any old feed to the web, it needs validation. • http://feedvalidator.org/ • Input the link to the code, it fixes any bugs you may have missed. • Also translates it into even more difficult code, which we don’t need to understand (thankfully!) • The reason for this is that lots of websites on the internet STILL cant understand how to read and use RSS properly, despite it being called 2.0.
Step 8 – We’re Done! • That’s about it really. • Before you use a validator, your feed will look something like this:
Step 8 – Finished Feed • <?xml version="1.0"><rss version="2.0"> <channel><title>The title of my RSS 2.0 Feed</title> <link>http://www.azisalegend.com/</link><description>A website about the legend that is known as Azeem!</description> <language>en-uk</language><item> <title>Title of an item</title><link>http://azisalegend.com/howididit.html</link><description>How Az became a legend</description> </item> </channel> </rss>
Other things to note: • There are lots of different types of encoding, each has its own way of being written into RSS. • To make RSS appear ‘nicer’ on a page, it is possible to write RSS in a CSS way. • It is good practice to include a <category> tag within the <item> tag, as many more websites are now categorising their feeds so users can only subscribe to the genres they like.
Other things to note: • Content type – There are millions • This presentation was designed to show you how to make an RSS feed for a website that has static pages, such as news websites – pages that don’t have much active things on them, like flash pages, or javascript. • Complicated pages need complicated coding, the same is true of RSS.
And that really is it now..! • If you haven’t fallen asleep yet, thanks for listening!