Changing User Agent in Rome
Wednesday, October 19th, 2005If you are trying to use Rome and Rome Feed Fetcher, the following will not change the default user agent:
FeedFetcher feedFetcher = new HttpURLFeedFetcher();
feedFetcher.setUserAgent(\”User Agent 007\”);
SyndFeed feed = null;
feedURL = new URL(rssUrl);
feed = feedFetcher.retrieveFeed(feedURL);
List entries = feed.getEntries();
To change the user agent you must use the InfoCache as shown:
FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
FeedFetcher feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
feedFetcher.setUserAgent(\”User […]