Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require OAuth2 v0.4.1 gem #1

Merged
merged 3 commits into from Jul 23, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions 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'
Expand All @@ -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",
Expand Down Expand Up @@ -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
5 changes: 3 additions & 2 deletions main.rb
@@ -1,5 +1,6 @@
require 'rubygems'
require 'sinatra'
gem 'oauth2', '=0.4.1'
require 'oauth2'
require 'json'
require 'net/https'
Expand All @@ -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",
Expand Down Expand Up @@ -48,4 +49,4 @@ def redirect_uri()

get '/' do
redirect client.web_server.authorize_url(:redirect_uri => redirect_uri)
end
end