简体   繁体   中英

Rails LinkedIn gem only gets first name and last name out of profile

I am currently trying to use this gem http://github.com/pengwynn/linkedin . Everything works fine (ie authentication and calling the method which gets the profile), except that the profile 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM