Authors, Categories from RSS 1.0 Feeds

View: New views
1 Messages — Rating Filter:   Alert me  

Authors, Categories from RSS 1.0 Feeds

by Andreas Harth-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I've been trying to parse stuff such as authors, categories,
and images from RSS news items.

I've tried the following code.  Strangely enough getAuthors returns
an empty list while getAuthor returns an author name.  The other
methods return empty results although the feed contains dc:subject
entries.  Searching the mailing list archives doesn't bring up anything
helpful.

public void testFetch() throws IOException, IllegalArgumentException,
FeedException {
        URL url = new URL("http://rss.slashdot.org/Slashdot/slashdot");
        SyndFeedInput input = new SyndFeedInput();
        URLConnection conn = url.openConnection();
        SyndFeed feed = input.build(new XmlReader(conn));
        List li = feed.getEntries();
        for (int i=0; i<li.size(); i++) {
                SyndEntry sei = (SyndEntry)li.get(i);
                System.out.println("author: " + sei.getAuthor());
                System.out.println("authors: " + sei.getAuthors());
                System.out.println("categories: "+sei.getCategories());
                System.out.println("enclosures: "+sei.getEnclosures());
                }
        }
}

Any help, sample code, or pointers to documentation highly appreciated!

Cheers,
Andreas.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...