Socket
Book a DemoInstallSign in
Socket

twitter-auto-oauth

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitter-auto-oauth

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

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

twitter

FAQs

Package last updated on 18 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.