No commit activity in last 3 years
No release in over 3 years
Based on get-twitter-oauth-token
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.5.0
 Project Readme

twitter_oauth_token

Gimme that Twitter OAuth access token!

Circle CI Gem Version

This is the library version of the get-twitter-oauth-token command line tool 😅

Installation

$ gem install twitter_oauth_token

Usage

$ irb
irb(main):001:0> require 'twitter_oauth_token'
=> true
irb(main):002:0> TwitterOAuthToken::get
[Step 1 of 4] consumer key: ...
[Step 2 of 4] consumer secret: ...
[Step 3 of 4] open this link in a browser (sign in and authorize): https://api.twitter.com/oauth/authorize?oauth_token=jKbOtQAAAAAAt_QtAAABU1NHQWU
[Step 4 of 4] enter pin: 1374423
=> {"access_token"=>"...", "access_token_secret"=>"...", "error"=>nil}

🎉

Custom Prompts

prompts = {
  TwitterOAuthToken::PROMPT_CONSUMER_KEY => 'Enter Twitter app consumer key: ',
  TwitterOAuthToken::PROMPT_CONSUMER_SECRET => 'Enter Twitter app consumer secret: ',
  TwitterOAuthToken::PROMPT_OPEN_URL => 'Paste this URL in your browser: ',
  TwitterOAuthToken::PROMPT_PIN => 'What\'s the pin? '
}

TwitterOAuthToken::get(prompts)
# Enter Twitter app consumer key: ...
# ...

Examples

Credits

Contact

License

This project is available under the MIT license. See the LICENSE file for more info.