import java.io.IOException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.Iterator; import com.sun.syndication.feed.synd.SyndEntry; import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.io.FeedException; import com.sun.syndication.io.SyndFeedInput; import com.sun.syndication.io.XmlReader; public class mainclass{ @SuppressWarnings({ "rawtypes" }) public static void main(String [] args){ try{ URL url = new URL("http://mybroadband.co.za/news/tag/mtn/feed"); HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection(); httpURLConnection.setRequestProperty("User-Agent", "Mozilla/5.0"); SyndFeedInput input = new SyndFeedInput(); SyndFeed feed = null; try { feed = input.build(new XmlReader(httpURLConnection)); } catch (IllegalArgumentException | FeedException e) { // TODO Auto-generated catch block e.printStackTrace(); } //List entries =(List) feed.getEntries(); Iterator itEntries = feed.getEntries().iterator(); while(itEntries.hasNext()){ SyndEntry entry = (SyndEntry)itEntries.next(); //System.out.print(entry.getTitle()+"\n"); //System.out.println("Description"); System.out.print("TITLE: "+entry.getTitle() +"\n"); System.out.print("Discription:"); System.out.print(entry.getDescription() +"\n"); } } catch(MalformedURLException e){ e.printStackTrace(); } catch(IOException e){ e.printStackTrace(); } } }
<wfw:commentRss>http://....html/feed</wfw:commentRss>
wfw
"http://wellformedweb.org/CommentAPI/"
"\<wfw\:commentRss\>(.*)\<\/wfw\:commentRss\>"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)