Sunday 15 July 2012

java - how to retrive the rss link which is in anchor tag? -



java - how to retrive the rss link which is in anchor tag? -

public string getrsslinkfromurl(string url) { org.jsoup.select.elements links; seek { // using jsoup library parse html source code org.jsoup.nodes.document doc = jsoup.connect(url).get(); // finding rss links having link[type=application/rss+xml] links = doc.select("link[type=application/rss+xml]"); // check if urls found or not if (links.size() > 0 ) { rss_url = links.get(0).attr("href").tostring(); } } grab (ioexception e) { e.printstacktrace(); } // returing rss url homecoming rss_url; }

i developing android rss application .this code snippets.here rss links in link tag matched , retrieved. problem rss links in anchor tag can not retrieved because not have mutual attribute value. u have other solutions. pls reply.

thank you..

i don't know how people understood question.

please mention 1) coding strategy 2) platform working(is android?? or java ???) 3) using php??

you may seek :

<webview android:id="@+id/web_view" android:layout_width="fill_parent" android:layout_height="wrap_content" />

in java class file:

protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.your_layout); webview wb = (webview) findviewbyid(r.id.web_view); wb.loaddatawithbaseurl("", "<b> html text </b>", mimetype, encoding, ""); }

java android

No comments:

Post a Comment