I love reading different blogs and websites. I think it’s amazing how the Internet has allowed us to connect in all these new and interesting ways. Everything changes on the web so quickly, but I really want to keep up with what my favourite sites are creating. That’s where RSS comes in. RSS is a special file format that allows you to stay in the loop with your favourite websites, if they support it. All a site needs to do is have a page where their RSS feed can be found. This feed has a list of some of the site’s latest posts. Tons of different applications support RSS, but I haven’t found a product that perfectly matches my tastes when it comes to how I want to receive content. That’s why I’ve decided to start the adventure of building my own RSS reader web app. What this’ll allow me to do is to collect multiple RSS feeds from different sites and be able to see the latest articles all in one place. I’ve never really dived deep into RSS before, so this new project gives me the perfect chance to do just that!
My first question before I started this project was: how do I keep track of when a feed adjusts? From what I’ve found it seems to be there’s a couple of main methods you need to use to do it. I don’t want to get a bunch of duplicates of an article and I wanted to ensure I wasn’t fetching a feed too often. The answer to these questions lies in conditional GET requests and keeping track of IDs. Each post in an RSS feed can have an ID which you can use to make sure you don’t accidentally add a duplicate. You can also potentially use the URL as an ID as well. A conditional GET request is the second piece of the puzzle. This is functionality that’s built right into HTTP, the protocol which helps you get data on the web. Essentially, you can request a page (like an RSS feed) and if something’s changed, you’ll load the RSS feed, but if everything’s the same, you’ll get an empty feed. How does the server know whether to give you an updated version or not? In your request, you need to provide something called an ETag. You get this tag when you first requested the page. The server will check to see if the tag you provided is the latest one. Based on that it’ll provide you an updated version of the page or you won’t finish your request. This saves time and bandwidth for you and the server.
With that, I know have a better idea of how and when to update my feed reader with new articles. I’m one step closer to starting my project. Until next time!