Procházet zdrojové kódy

add atom example

master
Wito Chandra před 8 roky
rodič
revize
51b6b5b555
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  1. +12
    -0
      example/main.dart

+ 12
- 0
example/main.dart Zobrazit soubor

@@ -1,8 +1,11 @@
import 'package:http/http.dart' as http;
import 'package:webfeed/domain/atom_feed.dart';
import 'package:webfeed/domain/rss_feed.dart';

void main() {
var client = new http.Client();

// RSS feed
client.get("https://developer.apple.com/news/releases/rss/releases.rss").then((response) {
return response.body;
}).then((bodyString) {
@@ -10,4 +13,13 @@ void main() {
print(channel);
return channel;
});

// Atom feed
client.get("https://www.theverge.com/rss/index.xml").then((response) {
return response.body;
}).then((bodyString) {
var feed = new AtomFeed.parse(bodyString);
print(feed);
return feed;
});
}

Načítá se…
Zrušit
Uložit