DEC
09
Rome
Enviado por 200.217.209.228. - Histórico - Editar
Rome (https://rome.dev.java.net) é uma biblioteca muito fácil de usar para leitura e criação de RSS / Atom feeds.
Atualmente suporta:
- RSS 0.90,
- RSS 0.91 Netscape,
- RSS 0.91 Userland,
- RSS 0.92,
- RSS 0.93,
- RSS 0.94,
- RSS 1.0,
- RSS 2.0,
- Atom 0.3,
- Atom 1.0
A leitura é bem simples de ser feita:
1 SyndFeedInput input;
2 try {
3 // Load the feed, regardless of RSS or Atom type
4 input = new SyndFeedInput();
5 SyndFeed reader = input.build(new XmlReader(new URL(feed)));
6
7 // Loops showing the news if are really news
8 Iterator entryIter = reader.getEntries().iterator();
9 while (entryIter.hasNext()) {
10 SyndEntry entry = (SyndEntry) entryIter.next();
11
12 // Usar métodos getTitle() getLink(), getDescription, getDate, getIcon, etc
13 }
14
15 // All right..
16 } catch (Exception e) {
17 // show exception e;
18 }
Artigos Relacionados
Rome;
