Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm using this method to read RSS Feeds from URL. Everything works fine except it fails to get feeds from .net webserver (eg. http://www.dotnetnuke.com/Resources/Blogs/rssid/99.aspx).

public String getRSSLinkFromURL(String url) {
// RSS url
    String rss_url = null;

    try {
    // Using JSoup library to parse the html source code
    org.jsoup.nodes.Document doc = Jsoup.connect(url).get();
    // finding rss links which are having link[type=application/rss+xml]
    org.jsoup.select.Elements links = doc.select("link[type=application/rss+xml]");

    Log.d("No of RSS links found", " " + links.size());

    // check if urls found or not
    if (links.size() > 0) {
        rss_url = links.get(0).attr("href").toString();
    } else {
        // finding rss links which are having link[type=application/rss+xml]
        org.jsoup.select.Elements links1 = doc.select("link[type=application/atom+xml]");
        if(links1.size() > 0){
            rss_url = links1.get(0).attr("href").toString();    
        }
    }

    } catch (IOException e) {
    e.printStackTrace();
    }

    // returing RSS url
    return rss_url;
}
share|improve this question
have a look here stackoverflow.com/questions/1253788/… – kumar_android Nov 30 '12 at 16:57
not related to my question – user1781367 Dec 5 '12 at 13:47

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.