49 lines
1.3 KiB
Dart
49 lines
1.3 KiB
Dart
// ignore_for_file: avoid_print
|
|
|
|
import 'package:wyatt_medium_feeds/wyatt_medium_feeds.dart';
|
|
|
|
Future<void> main() async {
|
|
final mediumFeed = MediumFeed.fromPublicationName('flutter');
|
|
await mediumFeed.parse();
|
|
|
|
print(mediumFeed.url);
|
|
final feed = mediumFeed.feed;
|
|
|
|
print(feed.title);
|
|
print('${feed.image?.url}\n');
|
|
|
|
// if ((feed.items?.length ?? 0) > 0) {
|
|
// for (final item in feed.items!) {
|
|
// print(item.title);
|
|
// print(item.pubDate?.toIso8601String());
|
|
// print(item.guid);
|
|
// print(item.dc?.creator);
|
|
// print('${item.content?.value.readingTime().inMinutes} min read');
|
|
|
|
// if ((item.categories?.length ?? 0) > 0) {
|
|
// final StringBuffer categories = StringBuffer('[');
|
|
// for (final category in item.categories!) {
|
|
// categories.write('"${category.value}"');
|
|
// if (item.categories!.indexOf(category) <
|
|
// item.categories!.length - 1) {
|
|
// categories.write(', ');
|
|
// }
|
|
// }
|
|
// categories.write(']');
|
|
// print(categories);
|
|
// }
|
|
// print('\n');
|
|
// }
|
|
// }
|
|
|
|
for (final MediumArticle a in mediumFeed.articles) {
|
|
print(a.title);
|
|
print(a.author);
|
|
print(a.guid);
|
|
print(a.summary);
|
|
print(a.publishDate);
|
|
print(a.readingTime);
|
|
print('\n');
|
|
}
|
|
}
|