I am currently trying to use this gem http://github.com/pengwynn/linkedin. Everything works fine (i.e. authentication and calling the method which gets the profile), except that the profil开发者_JS百科e object only contains the first name and the last name.
I'm trying to get my own profile info through the LinkedIn API, So the necessary information is there. How to do that?
Thank you.
I just found out that in order to get more info rather that first name and last name, one needs to pass in the :fields param specifying the desired fields.
Link LinkedIn into your next Ruby application
Example from the site:
# get a profile for someone found in network via ID client.profile(:id => 'gNma67_AdI', :fields => %w(first-name, last-name, headline, positions, education))
By design, the LinkedIn api does not give you the person's email address. (Unlike the Google oauth api).
What you can get from the LinkedIn api is information about the person's connections (friends) and more. See overview. Their profile api
Added: could be that the Rails LinkedIn gem does not yet expose all of the LinkedIn Profle api. That api has changed relatively recently. It may be that you'll need to find another gem or write you own sw to do it. Check on the LinkedIn api forum
精彩评论