galnet_rss 0.2.0
galnet_rss: ^0.2.0 copied to clipboard
'A lightweight Dart client for accessing **Galnet** articles from the video game *Elite: Dangerous*, using the official RSS feed.'
example/galnet_rss_example.dart
import 'dart:io';
import 'package:galnet_rss/galnet_rss.dart';
///
Future<void> main() async {
/// UserAgent is mandatory so each client can be identified
final GalnetRssClient galnetRssClient = GalnetRssClient(
userAgent: 'exampleClient/0.0.0',
);
/// For a list of locales see [Locale]
/// They're all the languages supported by the (https://elitedangerous.com)[Elite Dangerous Website]
final List<GalnetArticle> articles = await galnetRssClient.fetch(
locale: Locale.enGB,
);
/// There's no way to get more articles than those in the feed
for (final GalnetArticle article in articles) {
stdout.writeln('''
${article.title}
${article.pubDate}
(HTML formatting is kept)
${article.description}
''');
}
}