Browse files

Moved API Token Helper App

The sinatra app included to get an API token should not be in the bin
directory, because it's not meant to be an executable file used by normal
users of the gem (and because I don't want the gem to depend on sinatra and
omniauth outside of a development context.)
  • Loading branch information...
1 parent c76e008 commit cfeabfd4e9bb1d2f89a53f8c71ed1b5cbb40f670 @jwilger committed Jul 3, 2011
Showing with 23 additions and 26 deletions.
  1. +19 −13 README.rdoc
  2. +4 −13 {bin → }/github-v3-api-get-token
@@ -9,18 +9,25 @@ credentials in the application itself.
Because this library requires an OAuth2 access token from GitHub, you will need
to obtain such a token in order to do command-line testing of the library via
-IRB. To that end, a template sinatra application is included in the source at
-<tt>get_access_token_sinatra_app.rb.template</tt>. You will need to copy that
-file to <tt>get_access_token_sinatra_app.rb</tt> (drop the .template) and
-replace YOUR_APP_ID and YOUR_APP_SECRET with the values for a GitHub application
-that you can create at (for the URL
-and Callback URL options, enter http://localhost:4567 and
-http://localhost:4567/auth/github/callback respectively.)
-Then just run <tt>ruby get_access_token_sinatra_app.rb</tt> and point your web
-browser at http://localhost:4567 whereupon you will be prompted to authorize
-your app at GitHub. If you allow it, you will be presented with an access token
-that you can then copy and paste in where needed.
+IRB. The source for this gem includes a simple sinatra web application that can
+get an access token for you. You will need to create a GitHub application first
+by visiting For the URL and
+Callback URL options, enter http://localhost:4567 and
+http://localhost:4567/auth/github/callback respectively (include "http://" in
+front of both; RDoc formatting seems to strip that bit out of the rendered
+documentation.) After creating the
+application, your client ID and client secret will be displayed, and you will
+use those values to run the script.
+Then just run:
+ OAUTH_GITHUB_CLIENT_ID={client_id} \
+ OAUTH_GITHUB_CLIENT_SECRET={client_secret} \
+ ./github-v3-api-get-token
+and point your web browser at http://localhost:4567. You will be prompted to
+authorize your app at GitHub. If you allow it, you will then be presented with
+an access token that you can then copy and paste in where needed.
== Contributing to github-v3-api
@@ -41,4 +48,3 @@ that you can then copy and paste in where needed.
Copyright (c) 2011 John Wilger. See LICENSE.txt for
further details.
@@ -3,19 +3,10 @@
puts <<EOF
This script will start a sinatra web app on your machine that can log you in to
GitHub and show you your access token. This access token can then be used with
-the GitHubV3API.
-Once the server has started, just browse to http://localhost:4567. You may be
-prompted to log in to GitHub and/or authorize the app. After that, your access
-token will be displayed to you.
-You will need to create a GitHub Application in order to use this. Just go to
- and fill out the form. Pick any name
-you want, and use http://localhost:4567 and
-http://localhost:4567/auth/github/callback for the Main and Callback URLs,
-respectively. After creating the application, use the generated client id and
-client secret by running this script with the OAUTH_GITHUB_CLIENT_ID and
-OATH_GITHUB_CLIENT_SECRET environment variables set.
+the GitHubV3API. You will need to set the OAUTH_GITHUB_CLIENT_ID and
+OAUTH_GITHUB_CLIENT_SECRET environment variables. See the README for more
print "Ready to go? (y/N): "

0 comments on commit cfeabfd

Please sign in to comment.