twitter_api_v2 0.0.1
twitter_api_v2: ^0.0.1 copied to clipboard
The lightweight and powerful wrapper library for Twitter API v2.0 written in Dart language. It works cross-platform.
The Lightweight and Cross-Platform Wrapper for Twitter API v2.0.
1. Guide #
This library provides the easiest way to use Twitter API v2.0.
Show some ❤️ and star the repo to support the project.
1.1. Getting Started #
1.1.1. Install Library #
With Dart:
dart pub add twitter_api_v2
Or With Flutter:
flutter pub add twitter_api_v2
1.1.2. Import #
import 'package:twitter_api_v2/twitter_api_v2';
1.1.3. Implementation #
import 'package:twitter_api_v2/twitter_api_v2.dart';
void main() async {
// You need to get keys and tokens at
// https://developer.twitter.com
final twitter = TwitterApi(
consumerKey: 'YOUR_CONSUMER_KEY', // Or it's called "API Key"
consumerSecret: 'YOUR_CONSUMER_SECRET', // Or it's called "API Secret"
accessToken: 'YOUR_ACCESS_TOKEN',
accessTokenSecret: 'YOUR_ACCESS_TOKEN_SECRET',
);
try {
final me = await twitter.usersService.lookupMe();
final tweets = await twitter.tweetService.searchRecent(query: 'Elon Musk');
final response = await twitter.tweetService.likes(
userId: me.data.id,
tweetId: tweets.data.first.id,
);
print(response);
} on TwitterException catch (e) {
print(e.response.headers);
print(e.response.body);
}
}
1.2. Contribution #
If you would like to contribute to twitter_api_v2
, please create an issue or create a Pull Request.
Owner will respond to issues and review pull requests as quickly as possible.
1.3. Support #
The simplest way to show us your support is by giving the project a star at here.
And I'm always looking for sponsors to support this project. I'm not asking for royalties for use in providing this framework, but I do need support to continue ongoing open source development.
Sponsors can be individuals or corporations, and the amount is optional.
1.4. License #
All resources of twitter_api_v2
is provided under the BSD-3
license.
Note: License notices in the source are strictly validated based on
.github/header-checker-lint.yml
. Please check header-checker-lint.yml for the permitted standards.
1.5. More Information #
twitter_api_v2
was designed and implemented by Kato Shinya.