Skip to content

Instantly share code, notes, and snippets.

@redsquirrel
Created April 30, 2014 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redsquirrel/8b22d6808a1574356d16 to your computer and use it in GitHub Desktop.
Save redsquirrel/8b22d6808a1574356d16 to your computer and use it in GitHub Desktop.
Trying (and failing) to use the LinkedIn Search API
require 'rubygems'
require 'linkedin'
client = LinkedIn::Client.new('75abcxm123himom', 'NDwtffWomglylolV')
request_token = client.request_token({}, :scope => "r_network")
rtoken = request_token.token
rsecret = request_token.secret
client.authorize_from_access(rtoken, rsecret)
p client.search("Grace Hopper")
# /Library/Ruby/Gems/2.0.0/gems/linkedin-0.4.7/lib/linked_in/helpers/request.rb:52:in `raise_errors': (403): People search must be done on behalf of a member. (LinkedIn::Errors::AccessDeniedError)
# from /Library/Ruby/Gems/2.0.0/gems/linkedin-0.4.7/lib/linked_in/helpers/request.rb:16:in `get'
# from /Library/Ruby/Gems/2.0.0/gems/linkedin-0.4.7/lib/linked_in/search.rb:31:in `search'
# from play.rb:28:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment