Skip to content

Commit

Permalink
Pull profile URL from LinkedIn, closes omniauth#81
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bleigh committed Nov 3, 2010
1 parent b6efe08 commit dfcc591
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion oa-oauth/lib/omniauth/strategies/linked_in.rb
Expand Up @@ -23,7 +23,7 @@ def auth_hash
end

def user_hash(access_token)
person = Nokogiri::XML::Document.parse(@access_token.get('/v1/people/~:(id,first-name,last-name,headline,member-url-resources,picture-url,location)').body).xpath('person')
person = Nokogiri::XML::Document.parse(@access_token.get('/v1/people/~:(id,first-name,last-name,headline,member-url-resources,picture-url,location,public-profile-url)').body).xpath('person')

hash = {
'id' => person.xpath('id').text,
Expand All @@ -38,7 +38,9 @@ def user_hash(access_token)
end
}

hash['urls']['LinkedIn'] = person.xpath('public-profile-url').text
hash[:name] = "#{hash['first_name']} #{hash['last_name']}"

hash
end
end
Expand Down

0 comments on commit dfcc591

Please sign in to comment.