Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何以编程方式从博客站点查找博客提要URL_Java_Rss_Blogs_Google Reader_Rome - Fatal编程技术网

Java 如何以编程方式从博客站点查找博客提要URL

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

我们使用下面的代码来阅读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.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