Skip to content
Browse files

Merge pull request #1 from wehal3001/master

require OAuth2 v0.4.1 gem
  • Loading branch information...
2 parents c1aa42f + bcbf1da commit 2371d8caa7bb64179dbbe3b423bdd085ea656d96 @mh committed Jul 22, 2012
Showing with 7 additions and 5 deletions.
  1. +4 −3 README.rdoc
  2. +3 −2 main.rb
View
7 README.rdoc
@@ -1,10 +1,11 @@
== foursquare APIv2 Sinatra Example
-This shows how easy it is to use Foursquare APIv2 via the OAuth2 gem.
+This shows how easy it is to use Foursquare APIv2 via the OAuth2 gem (requires v0.4.1).
== code
require 'rubygems'
require 'sinatra'
+ gem 'oauth2', '=0.4.1'
require 'oauth2'
require 'json'
require 'net/https'
@@ -16,7 +17,7 @@ This shows how easy it is to use Foursquare APIv2 via the OAuth2 gem.
def client
OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET,
- :site => ' http://foursquare.com/v2/',
+ :site => 'http://foursquare.com/v2/',
:request_token_path => "/oauth2/request_token",
:access_token_path => "/oauth2/access_token",
:authorize_path => "/oauth2/authenticate?response_type=code",
@@ -53,4 +54,4 @@ This shows how easy it is to use Foursquare APIv2 via the OAuth2 gem.
get '/' do
redirect client.web_server.authorize_url(:redirect_uri => redirect_uri)
- end
+ end
View
5 main.rb
@@ -1,5 +1,6 @@
require 'rubygems'
require 'sinatra'
+gem 'oauth2', '=0.4.1'
require 'oauth2'
require 'json'
require 'net/https'
@@ -11,7 +12,7 @@
def client
OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET,
- :site => ' http://foursquare.com/v2/',
+ :site => 'http://foursquare.com/v2/',
:request_token_path => "/oauth2/request_token",
:access_token_path => "/oauth2/access_token",
:authorize_path => "/oauth2/authenticate?response_type=code",
@@ -48,4 +49,4 @@ def redirect_uri()
get '/' do
redirect client.web_server.authorize_url(:redirect_uri => redirect_uri)
-end
+end

0 comments on commit 2371d8c

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