lib/omniauth/strategies/linked_in.rb in oa-oauth-0.0.1 vs lib/omniauth/strategies/linked_in.rb in oa-oauth-0.0.4
- old
+ new
@@ -1,8 +1,7 @@
-require 'omniauth/core'
-require 'omniauth/strategies/oauth'
require 'nokogiri'
+require 'omniauth/oauth'
module OmniAuth
module Strategies
class LinkedIn < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key, consumer_secret)
@@ -31,17 +30,17 @@
'first_name' => person.xpath('first-name').text,
'last_name' => person.xpath('last-name').text,
'location' => person.xpath('location/name').text,
'image' => person.xpath('picture-url').text,
'description' => person.xpath('headline').text,
- 'urls' => person.css('member-url-resources member-url').inject({}) do |hash,element|
- hash[element.xpath('name').text] = element.xpath('url').text
- hash
+ 'urls' => person.css('member-url-resources member-url').inject({}) do |h,element|
+ h[element.xpath('name').text] = element.xpath('url').text
+ h
end
}
hash[:name] = "#{hash['first_name']} #{hash['last_name']}"
hash
end
end
end
-end
\ No newline at end of file
+end