Java 如何以编程方式从博客站点查找博客提要URL
我们使用下面的代码来阅读RSS | ATOM提要,有没有办法找到博客提要的RSS | ATOM URL并提供给博客站点(例如http://my.typepad.com 或http://occupylosangeles.org/)。这应该类似于google.com/reader所做的Java 如何以编程方式从博客站点查找博客提要URL,java,rss,blogs,google-reader,rome,Java,Rss,Blogs,Google Reader,Rome,我们使用下面的代码来阅读RSS | ATOM提要,有没有办法找到博客提要的RSS | ATOM URL并提供给博客站点(例如http://my.typepad.com 或http://occupylosangeles.org/)。这应该类似于google.com/reader所做的 import com.sun.syndication.feed.atom.Feed; import com.sun.syndication.feed.module.Module; import com.sun.syn
import com.sun.syndication.feed.atom.Feed;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.feed.synd.SyndCategory;
import com.sun.syndication.feed.synd.SyndContent;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.feed.synd.SyndFeedImpl;
import com.sun.syndication.fetcher.FeedFetcher;
import com.sun.syndication.fetcher.FetcherEvent;
import com.sun.syndication.fetcher.FetcherListener;
import com.sun.syndication.fetcher.impl.FeedFetcherCache;
import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;
FeedFetcher fetcher = new HttpURLFeedFetcher(feedInfoCache);
// register listener to feed
FetcherEventListenerImpl listener = new FetcherEventListenerImpl();
fetcher.addFetcherEventListener(listener);
// Mechanism to read feeds via Rome Fetcher
SyndFeed feed = fetcher.retrieveFeed(new URL(feedURL));
罗马似乎没有这样的特色,但有办法。在HTML源中查找特定元素:
<link rel="alternate" type="application/rss+xml" href="http://url-of-an-rss-feed">
.使用此服务需要任何注册的应用程序密钥才能访问还是完全免费?此外,我找不到有关请求数的任何详细信息。API是否已润滑?
http://ajax.googleapis.com/ajax/services/feed/lookup?v=1.0&q=YOUR-PAGE-URL