javarss

To find whether the given URL is a RSS feed URL or not


I have a list of URLs which has to be processed and the result should be only the RSS feed URLS in that list.

How can I identify whether the given link is a RSS feed URL or not?

I need to build the program in Java and for your knowledge, am a beginner in Java.


Solution

  • There are a few things you can try, off of the top of my head:

    1. See what Content-Type the server returns for the given URL. However, this may not be definitive and a server may not necessarily return the correct header.
    2. Try to parse the content of the URL as RSS and see if it is successful - this is likely the only definitive proof that a given URL is a RSS feed.