twitter_openapi_dart 0.0.1 twitter_openapi_dart: ^0.0.1 copied to clipboard
Implementation of Twitter internal API in Dart.
twitter_openapi_dart #
Human-friendly Twitter OpenAPI
Sample app #
Build #
flutter pub run build_runner build --delete-conflicting-outputs
Setup #
It cannot be installed from pub.dev.
Plan to release it in v1.0.0 with pub.dev.
Recommend adding the latest commit hash after #ref as many destructive changes are made.
dependencies:
twitter_openapi_dart:
git:
url: https://github.com/fa0311/twitter_openapi_dart.git
path: twitter_openapi_dart
ref: <commit hash here>
Usage #
import 'package:twitter_openapi_dart/twitter_openapi_dart.dart';
Login #
Flutter (Recommendation)
Load cookie from flutter_inappwebview.
Other
final client = TwitterOpenapiDart.fromCookies(authToken: "<auth token here>", ct0: "<csrf token here>");
Do not login
final client = TwitterOpenapiDart.fromCookieJar(await getGuestCookies());
API #
test may be able to help you.
// https://twitter.com/elonmusk/status/1349129669258448897
final result = await client.getTweetApi().getTweetDetail(focalTweetId: "1349129669258448897");
if (result.cursor.bottom?.value == null) return;
final bottom = await client.getTweetApi().getTweetDetail(focalTweetId: "1349129669258448897", cursor: result.cursor.bottom?.value);