Rome Library to read feeds Java

2019-05-31 15:47发布

问题:

Hey people, i need to read the jpg url of this feed...:

    <author>asunderland@clubamerica.com.mx (Comunicación Club América)</author>
    <description><![CDATA[Conoce la historia de este guardameta americanista]]></description>
    <pubDate>Thu, 03 Jun 2010 01:06:23 CDT</pubDate> 
            <media:content url='http://i2.esmas.com/2009/09/06/69848/navarrete-300x150.jpg'/>
    <media:thumbnail url=''/>
    <content:encoded>

But this java library don't give me the function for get "media:content url='http://i2.esmas.com/2009/09/06/69848/navarrete-300x150.jpg', anyone can help me?? I already read this data: /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

SyndEntry entrada = it.next();
String title=(entrada.getTitle() );
String link=(entrada.getLink());
String author=(entrada.getAuthor());
String description=(""+entrada.getDescription() );
Date date=(entrada.getPublishedDate());
String date2= date.toString();
String content=(""+entrada.getContents());

Some idea folks???Thank u..

回答1:

There is a Rome extension for MediaRSS, a short descripton what jars are needed can be found at usage of rome media rss plugin and http://wiki.java.net/bin/view/Javawsxml/MediaRSS

The following code is untestet since I have only used rome to create a feed containing MediaRSS:

// SyndEntry entry = ...
MediaEntryModule mod = (MediaEntryModule) entry.getModule(MediaEntryModule.URI);
UrlReference ref = (UrlReference) mod.getMediaContents()[0].getReference();
URL url = ref.getUrl();


回答2:

Try the SyndEntry#getForeignMarkup()



标签: java rome