?
Solved

check if URL is a RSS ?

Posted on 2006-05-14
1
Medium Priority
?
317 Views
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 ?
)
0
Comment
Question by:ed987
1 Comment
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 1000 total points
ID: 16677333
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="http://www.w3.org/2005/Atom">

hope this helps

Cheers!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

864 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