1

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;
}
user1781367
  • 602
  • 4
  • 11
  • 24

1 Answers1

0

You RSS feed is broken: transfer closed with outstanding read data remaining.

curl will return that message when the socket has been closed before the final terminating chunk of a chunky transfer is read. It sure sounds like a server bug to me.

Source: [Re: transfer closed with outstanding read data remaining with Expect: 100-continue][1]

Fix (workaround) for JSoup is here:

https://github.com/jhy/jsoup/pull/323

MariuszS
  • 30,646
  • 12
  • 114
  • 155