Showing posts with label rss aggregator. Show all posts
Showing posts with label rss aggregator. Show all posts

Tuesday, 29 August 2017

Host Your Own RSS Feed Reader

rss feed
How to create an RSS feed from scratch


Today most of the systems we implement (such as WordPress) already come with a feed created and implemented, ready to validate, it is always possible to create a zero, or want to further customize what already exists.

Through a simple tutorial we will teach you to create an RSS feed from scratch, whether with static or dynamic content.

As always, first things first:

Reqirements for RSS feed:


A website with content, whether static or dynamic.

A Web editor.

Process of creating RSS feed:


To create an RSS feed, it is necessary to encode a file in XML format, which contains the necessary tags to interpret and display the content in the specified format, to which users will access. This file we can leave it native in XML, or embed it inside PHP, as we will see in both cases below.

For this we will perform 2 processes. In the first instance we will create a static feed, from content that we have available on our site.

After that we will repeat the task, but this time we will retrieve contents from a database to put them into the feed, ideal if they are publishing through a CMS or if they obtain content directly from a database.

So without further ado, let's get down to business:

1.- Creating a static RSS feed


This option is valid only if we have static content on our site, which although not very justified, can be a useful functionality to deliver to visitors.

For this, we need to create an XML file in our Web editor, and start coding:

The first 2 lines that we added correspond to the definition of the version and coding of xml (in order for it to validate correctly we must add the version, as far as the coding is optional but it never is) and the version of RSS that will use The file we are creating. Currently most sites offer subscriptions for both RSS 1.1 and 2.0, but with the latter is more than enough. At the end we close the rss tag to finish the document.

Following the above, it is necessary that everything related to the feed (both information and content), be included within the </ channel> tags, which we will add just after the previous code.

And now, inside the channel tags we will be adding the feed information.

And finally, after the information, we add the related content that will be displayed in the feed, we will do this by repeating the same tags we used previously, but closed between < item>and </ item>:

The above we save it with any name and with extension xml, we upload it and when opening it in the navigator we will be able to see that our static feed is completely ready:

2.- Creating a dynamic RSS feed


We created our static feed, its just onnly a few minutes, we realized that it was very simple and we are ready to conquer the world ... right ?. Well, not yet. As we indicated in the previous point, a static feed is not very funny, since we must add each new content manually and ends up being a lot of work, or it may be that on more than one occasion we forget to update. Due to this, if we have a site where the content is obtained dynamically from a database, it is possible to adapt that to our feed and that the new information will be added as it is generated. For this, we will work with both XML and PHP, in a bombastic that will spark and make us the most popular kids in high school.

For this, we will consider that we have a database, which has a news table with a title field, a link field, a detail field and a date field of the news, as we see below:

[Table id = 1 /]

So, the first thing to do is create a PHP file in our Web editor.

As you can see, in the previous code we left a blank section, between the <? Php and?> Tags. This part of the code is where we will connect to the database, rescue the news and deploy it dynamically.

For this, we will first connect to the database. As a good practice we will use DEFINE to define redundancy, define the connection data, but if you want, you can skip this part and execute the function directly:

And now we make the connection. We run the query.

Now that we have retrieved all the news from the database in an orderly way by date, obtaining the newest ones first, we will pass them to an array to write them in the specified XML format, as follows:

With the above, we execute a cycle that will pass to an array in an associative way (thanks to the parameter MYSQL_ASSOC, which will allow us to access the records in the array with the same name that they have in the table of the database). That they are finished and will create a new item with the respective values to include in the feed.

With that we are almost ready, the last detail is to add a small header at the beginning of the document, indicating that we are executing XML content for better recognition at the time of executing the complete script, we do this by adding at the beginning.

And ready!.

We have our dynamic RSS feed, which will add the results obtained from the database and each time we publish new content will be updated automatically.

And now, to conquer the world ?. Not yet. Before finishing:

3.- Useful tips for launching RSS feed


Some tips that are never over:

Validate feed

Before launching our feed to the public, it's good to make sure that it works properly and that we have not made coding errors. For this we can validate through several services, such as:

W3C Validator

Feed Validator

Just add the URL of our feed and validate.

Publish the feed

There are services that allow us to publish our feed and offer a series of interesting features, such as adding advertising or statistics about our subscribers. The best known and undoubtedly used is Feedburner, which in only moments we can publish our feed without problems.

Show users that a RSS feed exists on the site

If at this moment they look at the address bar of your browser, you will see that there is an orange icon.
This icon indicates that the site has an RSS feed to which they can subscribe. How to add it? Very simple, we should only add the following lines between the <head> and </ head> tags of each page we want it to appear in, such as a favicon. Simple, right?

and </ head> tags of each page we want it to appear in, such as a favicon. Simple, right?

Customize your RSS feed


The details certainly make the difference in the minds of the users. So, now that we've learned how to make a feed from scratch, why not play it a bit and make it more personalized? Only by modifying small parts of the code can we display certain types of information in our feed (for example comments if they exist), or limit the number of articles to be displayed, or make a separate feed for each person that writes in the site and thus each Reader follow his favorite author.

The possibilities are many, you just have to experiment.

And with this we have finished this tutorial in which we have covered the process of creating an RSS feed from scratch. As you can see, it only takes a few minutes and the difficulty is low, so we encourage you to try and tell us your experience.

Before ending, we remind you that as always, this tutorial has been:

Any questions or comments you may have, we invite you to leave us a few lines in the area enabled below.
We hope this tutorial has been useful for you.

Wednesday, 19 June 2013

Digg Going for its own RSS feed on 26th



Since the announcement of the closure of Google Reader, a popular reading service and synchronize RSS feeds, candidates to succeed him have multiplied. Among them, Digg has announced that early offer an alternative, but we had not yet seen the color, while the Google service will close in less than two weeks. In a new article, the site details the first beta version of its service which will also be launched on June 26. Limited, this first beta will target heavy users of RSS and it aims to offer a simple alternative, but functional Google Reader. Specifically, the Digg service will retrieve data from the Google and it will be available on the web and on the iPhone and iPad. The interface should be simple and clear and highlight the content; a mobile version will be available for those who do not have an iPhone. We should also find all the basic functions of a dedicated reading and flow synchronization services by including in a flow sharing section and organization records. After this beta to be released in extremis - hope that the launch will take place without quack ... - Digg has already planned improvements for its service. An Android application is provided, additional services will be integrated as Evernote or IFTTT and most advanced sorting and filtering tools are available. Still research and notifications are planned. Digg RSS is a paid, or rather freemium service. The basic functions will remain free, but can be a subscription that will unlock other features. Initially, however, the publisher intends to propose a viable alternative to Google Reader service. It will be hard to do while alternatives are already in place, especially since we do not know the position of the service API. Without it, Digg will never be integrated with third party software, like Reeder.

Wednesday, 10 April 2013

Feedly gets 3 million users in just 2 weeks!



Feedly has received 3 million new users following the announcement of the closure of Google Reader; that too only within 2 weeks. A number really unbelievable! And as the startup does not keep both feet in the same shoe, it advances its application continuously. For proof, Feedly today announced a new version of its RSS aggregator for mobile / tablet and computer. The first visible change when it connects to the player via Desktop is the automatic expansion of the play area to the entire screen. -An advanced search engine, faster and allows auto completion and displaying the results (with related tags) in real time as and when you type the keywords. Content discovery is (besides our RSS feed added) among the 50 million streams identified by the aggregator. A file-"Must Reads" which allows you never miss the most important items among the feeds that matter most. You must go to each feed are considered important Must Reads check the box and the file will appear at the top left, just below "Today" and before "All". See the overview screen Smartphone below: To refresh the content on your phone in 1 second, Feedly has added a "Pull to refresh". Always mobile, the new default view (my favorite) is the one that shows only the Securities News (can scan faster news a glance). Buttons-sharing and backup: they are numerous and really take time to practice on Feedly. In one click, you can send an article about Twitter, Facebook, Google +, the email or any application available on your phone, in Pocket (to read later) or saved items of Feedly (File "Saved for Later") in Buffer (to post later), copy the link of the post in the clipboard, etc. About its business model now, according to Techcrunch, Feedly will opt for the Freemium: free for everyone and paying for users who want to have more options, such as Dropbox and Evernote integration in particular, but also access to newspapers usually Pay by subscription. Charging is quite healthy and will reassure the sustainability of the service in the long term. For RSS readers have top but not sure they will succeed to survive in six months, it's not looking that most aggregators users.