gelbooru 4.0.0 copy "gelbooru: ^4.0.0" to clipboard
gelbooru: ^4.0.0 copied to clipboard

A universal package for connectiong ot various gelbooru based imageboards.

example/lib/gelbooru_example.dart

import 'dart:io';

import 'package:gelbooru/gelbooru.dart';
import 'package:http/http.dart';

/// Get last 10 posts from Gelbooru
void main() async {
  final client = GelbooruClient.gelbooru(
      apiKey: 'your_api_key',
      userId: 'your_user_id',
      userAgent: 'your_user_agent');

  List<Post> posts;

  try {
    posts = await client.posts.index(limit: 10);

    /// Exception that happens when the client can't connect to the server
  } on ClientException catch (cex) {
    print(cex.message);
    exit(0);

    /// Exception that happens when the server returns an error
  } on GelbooruException catch (gex) {
    print(gex.message);
    exit(0);
  }

  for (Post post in posts) {
    print('${post.fileUrl}');
  }
}
0
likes
150
pub points
42%
popularity

Publisher

verified publisherprojetretro.io

A universal package for connectiong ot various gelbooru based imageboards.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

http, meta, xml

More

Packages that depend on gelbooru