rome media rss插件的用法 [英] usage of rome media rss plugin

查看:107
本文介绍了rome media rss插件的用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能解释如何使用此处?

我尝试了示例用法以及我可以在google中找到的所有其他内容(虽然不多),但无法正常使用.具体来说,应该返回MediaModule的getModule(MediaModule.URI)在media-rss feed上返回null.该Feed上的getModules()(请注意复数)仅返回一个模块,该模块是DCModule(到底是DCModule吗?)

I tried the sample usage and everything else i could find in google (which isn't much) but could not get it to work. Specifically, getModule(MediaModule.URI) which is supposed to return a MediaModule returns null on a media-rss feed. getModules() (note the plural) on that feed returns only one module which is a DCModule (what the hell is a DCModule?)

也许我需要做一些配置罗马的事情或使用插件的事情.?

Perhaps there is something i need to do to configure rome or something to use the plugin..?

顺便说一下,提要来自youtube的api.

And by the way, the feed is from youtube's api.

推荐答案

实际上,唯一适用于我的配置是使用最新版本的Rome(rome-1.0.jar)和最新版本的jdom(jdom.jar版本) 1.1.1)并获得最新版本的mediarss-0.2.2.jar(如果未作为附件随附于此

Actually the only configuration that worked for me is using the latest version of Rome (rome-1.0.jar) with the latest version of jdom (jdom.jar version 1.1.1) and get the latest release of mediarss-0.2.2.jar that it's not in the Rome repository, if not came along as an attachment from this forum thread.

一旦拥有了所有这些元素,只需验证对YouTube API的调用会返回RSS feed,因为使用标准的Atom feed根本不起作用,请尝试以下代码:

Once you have all these elements, just verify that your call to the YouTube API returns an RSS feed because with the standard Atom feed it doesn't work at all and give a try to the following code:

    URL url = new URL(urlAddress);
   SyndFeedInput input = new SyndFeedInput();
   SyndFeed feed = input.build (new XmlReader(url));
   for (Iterator<SyndEntry> i = feed.getEntries().iterator(); i
     .hasNext();) {
    SyndEntry entry = (SyndEntry)i.next();
    System.out.println(entry.getTitle());
    MediaEntryModule m = (MediaEntryModule)entry.getModule(MediaEntryModule.URI);
             System.out.println(m);    
   }

对YouTube API的调用就像这样:

The call to the YouTube API is like this one:

... gdata.youtube.com/feeds/api/videos?q=U2&alt=rss&v=2

...gdata.youtube.com/feeds/api/videos?q=U2&alt=rss&v=2

和部分获得的结果是:

2002年U2超级碗半场表演- 9/11致敬 MediaEntryModuleImpl.player = null MediaEntryModuleImpl.mediaGroups [0] .defaultContentIndex = null MediaEntryModuleImpl.mediaGroups [0] .contents [0] .expression = full MediaEntryModuleImpl.mediaGroups [0] .contents [0] .player = null MediaEntryModuleImpl.mediaGroups [0] .contents [0] .width = null MediaEntryModuleImpl.mediaGroups [0] .contents [0] .samplingrate = null MediaEntryModuleImpl.mediaGroups [0] .contents [0] .type = application/x-shockwave-flash .

U2 Super Bowl halftime show 2002 - 9/11 Tribute MediaEntryModuleImpl.player=null MediaEntryModuleImpl.mediaGroups[0].defaultContentIndex=null MediaEntryModuleImpl.mediaGroups[0].contents[0].expression=full MediaEntryModuleImpl.mediaGroups[0].contents[0].player=null MediaEntryModuleImpl.mediaGroups[0].contents[0].width=null MediaEntryModuleImpl.mediaGroups[0].contents[0].samplingrate=null MediaEntryModuleImpl.mediaGroups[0].contents[0].type=application/x-shockwave-flash . .

希望对您有帮助.

这篇关于rome media rss插件的用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆