How to get logged in user's complete profile information using gem 'linkedin', :git => “git://github.com/pengwynn/linkedin.git”?

血红的双手。 提交于 2019-12-10 11:48:51

问题


I am using gem 'linkedin', :git => "git://github.com/pengwynn/linkedin.git"

when i create client and get profile i get the following values

headline:   url: last_name: first_name:summary

my question is how to get user's

picture-url,public_profile_url: location: country: school_name: degree: field_of_study: start_date: end_date:

回答1:


use picture_url like follows

client.profile(:fields => [:headline, :first_name, :last_name, :picture_url,:educations, :positions])client.profile(:fields => [:headline, :first_name, :last_name, :picture_url,:educations, :positions])




回答2:


For a list of all the fields you can use see the documentation at LinkedIn https://developer.linkedin.com/documents/profile-fields

#Gemfile
gem 'linkedin-oauth2', '~> 1.0.0'

# Other file
api = LinkedIn::API.new(linkedin.token)
profile = api.profile(
  fields: [
      :headline,
      :first_name,
      :last_name,
      :email_address,
      :phone_numbers,
      :im_accounts,
      :industry,
      :main_address,
      :primary_twitter_account,
      :picture_url,
      :public_profile_url,
      :positions
    ]
  )


来源:https://stackoverflow.com/questions/10172841/how-to-get-logged-in-users-complete-profile-information-using-gem-linkedin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!