Skip to content

Instantly share code, notes, and snippets.

@mergulhao
Last active February 27, 2019 18:11
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 mergulhao/757c3bf86399acce81f91c823fdf69c9 to your computer and use it in GitHub Desktop.
Save mergulhao/757c3bf86399acce81f91c823fdf69c9 to your computer and use it in GitHub Desktop.
class Linkedin
include HTTParty
base_uri 'https://api.linkedin.com/v2'
def initialize(token)
@token = token
end
def me
self.class.get('/me', options)
end
private
def options
@options ||= { headers: { "Authorization": "Bearer #{@token}" } }
end
end
l = Linkedin.new("my-token")
l.me["id"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment