-
-
Save rstackhouse/2870001 to your computer and use it in GitHub Desktop.
require 'rubygems' | |
require 'linkedin' | |
client = LinkedIn::Client.new('api_key', 'api_secret') | |
rtoken = client.request_token.token | |
rsecret = client.request_token.secret | |
puts client.request_token.authorize_url | |
pin = gets | |
client.authorize_from_request(rtoken, rsecret, pin) |
Ruby is trying to make the last line into a hash. =>
is the unexpected tASSOC
Edited.
Now I get the following:
C:/RubyStack-3.2.3-0/ruby/lib/ruby/gems/1.9.1/gems/oauth-0.4.6/lib/oauth/consume
r.rb:178:in request': additional_authorization_required (OAuth::Problem) from C:/RubyStack-3.2.3-0/ruby/lib/ruby/gems/1.9.1/gems/oauth-0.4.6/lib/ oauth/consumer.rb:194:in
token_request'
from C:/RubyStack-3.2.3-0/ruby/lib/ruby/gems/1.9.1/gems/oauth-0.4.6/lib/
oauth/tokens/request_token.rb:18:in get_access_token' from C:/RubyStack-3.2.3-0/ruby/lib/ruby/gems/1.9.1/gems/linkedin-0.3.7/l ib/linked_in/helpers/authorization.rb:29:in
authorize_from_request'
from authenticate.rb:14:in `
Do you have your api_key and api_secret on line 4? additional_authorization_required
is the problem.
I get the following error on line 20:
TryingToUseLinkedInGem.rb:20: syntax error, unexpected tASSOC, expecting $end
=> ["rstackhouse", pin] # <= save these for future requests