tao

twitter-auto-oauth

Using just username/password get oauth_access and oauth_access_secret tokens to use with twitter

Showing:

Popularity

Downloads/wk

3

GitHub Stars

1

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

7

Size (min+gzip)

648.1KB

License

AGPL-3.0-or-later

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Username and password Twitter API authentication

This is pretty backwards, but I need to be able to use my app with different twitter accounts using Twitter API. Before I spent some steps fetching oauth_access and oauth_access_secret manually which was quite boring.

Now using Zombie.js I can automate whole process of obtaining authentication token. I made this into separate package to be easily re-used across my and other's apps.

Usage

var TAuth = require('twitter-auto-oauth');

var auth = new TAuth({
    username       : process.env.TWITTER_USERNAME,
    password       : process.env.TWITTER_PASSWORD,
    consumerKey    : process.env.CONSUMER_KEY,
    consumerSecret : process.env.CONSUMER_SECRET
});

auth.then(function(result) {
    /*
      result will contain something like this:

      {
          "user_id": "1234567",
          "screen_name": "twituser",
          "oauth_access_token": "12345678-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "oauth_access_token_secret": "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr"
      }
    */
}).catch(function(err) {
    throw err;
});

Tests

Right now there is only one test. You need to suply your own twitter username/password as well as consumer key/secret to run it. Consumer key/secret has to be obtained in developer panel on twitter.com.

TWITTER_USERNAME=username TWITTER_PASSWORD=password CONSUMER_KEY=kkkkkkkkkkkkkkkkkkkkkk CONSUMER_SECRET=ssssssssssssssssssssssssssssssssssssssssss npm test

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100