twitter_1user 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 68

twitter 1user #

pub package

Connect to Twitter API with OAuth1.0a. The access token is assumed to be obtained from the Twitter application details page. It is therefore ideal for single user applications.

Install #

Add this to your package's pubspec.yaml file.

dependencies:
  twitter_1user: ^1.0.1

You can install packages from the command line.

pub get

Example #

import 'package:twitter_1user/twitter_1user.dart';

main(List<String> arguments) async {
  Twitter twitter = new Twitter('CONSUMER KEY', 'CONSUMER SECRET',
      'ACCESS TOKEN', 'ACCESS TOKEN SECRET');

  String response = await twitter.request(
      'get', 'statuses/user_timeline.json', {});
  var tweets = jsonDecode(response);
  print(tweets[2]);

  response =
  await twitter.request('post', 'statuses/update.json', {'status': 'Hello!'});
  print(response);
}

LICENSE #

MIT

1.0.0 #

  • Initial version, created by Stagehand

example/example.dart

import 'dart:io' show Platform;
import 'dart:convert';
import 'package:twitter_1user/twitter_1user.dart';

Future<void> main(List<String> arguments) async {
  Map<String, String> env = Platform.environment;
  Twitter twitter = new Twitter(env['API_KEY'], env['API_SECRET'],
      env['ACCESS_TOKEN'], env['ACCESS_SECRET']);

  String response = await twitter
      .request('GET', 'statuses/user_timeline.json', {'trim_user': 'true'});
  var tweets = jsonDecode(response);
  print(tweets[1]['text']);

  response = await twitter
      .request('post', "statuses/update.json", {'status': 'Hello, ワールド!'});
  print(response);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  twitter_1user: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:twitter_1user/twitter_1user.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
36
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
68
Learn more about scoring.

We analyzed this package on Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:twitter_1user/twitter_1user.dart with components: io.

Health issues and suggestions

Document public APIs. (-1 points)

11 out of 11 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
convert ^2.1.1 2.1.1
crypto ^2.1.2 2.1.3
Transitive dependencies
charcode 1.1.2
collection 1.14.12
typed_data 1.1.6
Dev dependencies
pedantic ^1.7.0
test ^1.5.0