check if URL is a RSS ?

Posted on 2006-05-14
Last Modified: 2013-11-18
how can i do a fast check if given url contains RSS and not something else ?

what would be average RSS size ?
all RSS pages contain strings "?xml" as well ( either "<rss" or "<rdf" ) ?
is <rss always followed by space and <rdf by : ?
how many bytes should be read at least before checking if <rss or <rdf string are present ?
Question by:ed987
    1 Comment
    LVL 60

    Accepted Solution

    Hi ed987,

    > what would be average RSS size ?
    that is hard to say, that depends on the number of items in a channel,
    can be 1, can be 100

    XML pages in general have an XML declaration
    <?xml version="1.0" encoding="utf-8" ?>
    but that is not mandatory
    if it is not there it takes the value I showed, which is the default value

    I think your best bet is looking for the <rss> element
    I think it is a safe bet to rely on the version attribute to be there in the rss start tag

        <rss version="2.0">

    <rdf: is a prefixed element
    so it is likely that there is a ":" after the <rdf,
    but this is only providing you the metadata

    The safest bet is to look for the <rss> element

    if you want to include atom as well in your feed evaluation
    look for this
    <feed xmlns="">

    hope this helps


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
    Shoutout to Emily Plummer ( for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now