Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit cfeabfd4e9bb1d2f89a53f8c71ed1b5cbb40f670 1 parent c76e008
John Wilger authored July 03, 2011
32  README.rdoc
Source Rendered
@@ -9,18 +9,25 @@ credentials in the application itself.
9 9
 
10 10
 Because this library requires an OAuth2 access token from GitHub, you will need
11 11
 to obtain such a token in order to do command-line testing of the library via
12  
-IRB. To that end, a template sinatra application is included in the source at
13  
-<tt>get_access_token_sinatra_app.rb.template</tt>. You will need to copy that
14  
-file to <tt>get_access_token_sinatra_app.rb</tt> (drop the .template) and
15  
-replace YOUR_APP_ID and YOUR_APP_SECRET with the values for a GitHub application
16  
-that you can create at https://github.com/account/applications/new (for the URL
17  
-and Callback URL options, enter http://localhost:4567 and
18  
-http://localhost:4567/auth/github/callback respectively.)
19  
-
20  
-Then just run <tt>ruby get_access_token_sinatra_app.rb</tt> and point your web
21  
-browser at http://localhost:4567 whereupon you will be prompted to authorize
22  
-your app at GitHub. If you allow it, you will be presented with an access token
23  
-that you can then copy and paste in where needed.
  12
+IRB. The source for this gem includes a simple sinatra web application that can
  13
+get an access token for you. You will need to create a GitHub application first
  14
+by visiting https://github.com/account/applications/new.  For the URL and
  15
+Callback URL options, enter http://localhost:4567 and
  16
+http://localhost:4567/auth/github/callback respectively (include "http://" in
  17
+front of both; RDoc formatting seems to strip that bit out of the rendered
  18
+documentation.) After creating the
  19
+application, your client ID and client secret will be displayed, and you will
  20
+use those values to run the script.
  21
+
  22
+Then just run:
  23
+
  24
+    OAUTH_GITHUB_CLIENT_ID={client_id} \
  25
+    OAUTH_GITHUB_CLIENT_SECRET={client_secret} \
  26
+    ./github-v3-api-get-token
  27
+
  28
+and point your web browser at http://localhost:4567. You will be prompted to
  29
+authorize your app at GitHub. If you allow it, you will then be presented with
  30
+an access token that you can then copy and paste in where needed.
24 31
 
25 32
 == Contributing to github-v3-api
26 33
  
@@ -41,4 +48,3 @@ that you can then copy and paste in where needed.
41 48
 
42 49
 Copyright (c) 2011 John Wilger. See LICENSE.txt for
43 50
 further details.
44  
-
17  bin/github-v3-api-get-token → github-v3-api-get-token
@@ -3,19 +3,10 @@
3 3
 puts <<EOF
4 4
 This script will start a sinatra web app on your machine that can log you in to
5 5
 GitHub and show you your access token. This access token can then be used with
6  
-the GitHubV3API.
7  
-
8  
-Once the server has started, just browse to http://localhost:4567. You may be
9  
-prompted to log in to GitHub and/or authorize the app.  After that, your access
10  
-token will be displayed to you.
11  
-
12  
-You will need to create a GitHub Application in order to use this. Just go to
13  
-https://github.com/account/applications/new and fill out the form. Pick any name
14  
-you want, and use http://localhost:4567 and
15  
-http://localhost:4567/auth/github/callback for the Main and Callback URLs,
16  
-respectively. After creating the application, use the generated client id and
17  
-client secret by running this script with the OAUTH_GITHUB_CLIENT_ID and
18  
-OATH_GITHUB_CLIENT_SECRET environment variables set.
  6
+the GitHubV3API. You will need to set the OAUTH_GITHUB_CLIENT_ID and
  7
+OAUTH_GITHUB_CLIENT_SECRET environment variables. See the README for more
  8
+information.
  9
+
19 10
 EOF
20 11
 
21 12
 print "Ready to go? (y/N): "

0 notes on commit cfeabfd

Please sign in to comment.
Something went wrong with that request. Please try again.