com.rometools.modules.mediarss.package.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rome-modules Show documentation
Show all versions of rome-modules Show documentation
Plugin collection for the ROME RSS and Atom Utilities
This module supports Yahoo! MediaRSS elements for ROME feeds.
Sample usage:
SyndFeed feed = input.build( myRSSFile );
List entries = feed.getEntries();
for( int i = 0; i < entries.size(); i++ ){
System.out.println( ((SyndEntry) entries.get(i)).getModule( MediaModule.URI ) );
}
Alternatively, to add a media item to an entry:
MediaContent[] contents = new MediaContent[1];
MediaContent myItem = new MediaContent( new UrlReference("http://me.com/movie.mpg") );
contents[0] = myItem();
Metadata md = new Metadata();
Thumbnail[] thumbs = new Thumbnail[2];
thumbs[0] = new Thumbnail( new URL("http://me.com/movie1.jpg") );
thumbs[1] = new Thumbnail( new URL("http://me.com/movie2.jpg") );
md.setThumbnail( thumbs );
myItem.setMetadata( md );
MediaEntryModuleImpl module = new MediaEntryModuleImpl();
module.setContents( contents );
mySyndEntry.getModules().add( module );
© 2015 - 2025 Weber Informatics LLC | Privacy Policy