bonjour_madame 3.0.0
bonjour_madame: ^3.0.0 copied to clipboard
A client for the french risqué and osé website "Bonjour Madame"
example/bonjour_madame_example.dart
import 'dart:io';
import 'package:bonjour_madame/bonjour_madame.dart';
/// This example fetch the last posted "madame"
void main() async {
/// We're adding a custom User-Agent to the client
final BonjourMadameClient bonjourMadameClient = BonjourMadameClient(
userAgent: 'BonjourMadameClient/2025.02.04+2246',
);
try {
/// [mostRecent] is a custom shorthand in the library to get the first (last item add) to the feed
final Post mostRecent = await bonjourMadameClient.posts.latest;
stdout.write('''
__ Most recent "Bonjour Madame" Post __
Title: ${mostRecent.title}
Date: ${mostRecent.pubDate.toLocal()}
Link: ${mostRecent.link}
Image: ${mostRecent.src}
''');
} on BonjourMadameClientException catch (bmcex) {
stderr.writeln('Something went wrong : ${bmcex.message}');
exit(-1);
} on BonjourMadameServerException catch (sex) {
stderr.writeln(
'Server response is an error : ${sex.statusCode} ${sex.message}',
);
exit(-1);
}
exit(0);
}