Skip to content

Instantly share code, notes, and snippets.

@michaelrkn
Created March 20, 2013 05:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelrkn/5202571 to your computer and use it in GitHub Desktop.
Save michaelrkn/5202571 to your computer and use it in GitHub Desktop.
getting the access token for instagram from the command line
require 'launchy'
CLIENT_ID = 'a3506a51a28b4d639ca680123c43f88d'
REDIRECT_URI = 'http://www.epicodus.com/'
puts 'To use InstaCommandLine, you need to grant access to the app.'
puts 'Press enter to launch your web browser and grant access.'
gets
Launchy.open "https://instagram.com/oauth/authorize/?client_id=#{CLIENT_ID}&redirect_uri=#{REDIRECT_URI}&response_type=token"
puts "Now, copy the text from your address bar here that follows 'access_token=' and press enter:"
access_token = gets.chomp
Launchy.open "https://api.instagram.com/v1/users/1574083/?access_token=#{access_token}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment