From dfcc5912d3f97b588d5895a9dc5f95fd9a22306e Mon Sep 17 00:00:00 2001 From: Michael Bleigh Date: Wed, 3 Nov 2010 09:10:43 -0500 Subject: [PATCH] Pull profile URL from LinkedIn, closes #81 --- oa-oauth/lib/omniauth/strategies/linked_in.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oa-oauth/lib/omniauth/strategies/linked_in.rb b/oa-oauth/lib/omniauth/strategies/linked_in.rb index 3d7c749..a497eb5 100644 --- a/oa-oauth/lib/omniauth/strategies/linked_in.rb +++ b/oa-oauth/lib/omniauth/strategies/linked_in.rb @@ -23,7 +23,7 @@ module OmniAuth 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, @@ -38,7 +38,9 @@ module OmniAuth end } + hash['urls']['LinkedIn'] = person.xpath('public-profile-url').text hash[:name] = "#{hash['first_name']} #{hash['last_name']}" + hash end end