I create linkedin client like this.
client = LinkedIn::Client.new("3333", "rrrrrrr")
client.authorize_from_access(session[:atoken], session[:asecret])
and get profile information like this
@profile = client.profile
when i print the profile like "puts client.profile", i get the following out put
#<LinkedIn::Profile:0x4a77770 @doc=#<Nokogiri::XML::Document:0x253bb64 name="document" children=[#<Nokogiri::XML::Element:0x253b9fc name="pers
on" children=[#<Nokogiri::XML::Text:0x253b87c "\n ">, #<Nokogiri::XML::Element:0x253b84c name="first-name" children=[#<Nokogiri::XML::Text:0x
253b684 "Anthony">]>, #<Nokogiri::XML::Text:0x253b5ac "\n ">, #<Nokogiri::XML::Element:0x253b57c name="last-name" children=[#<Nokogiri::XML::
Text:0x253b3b4 "Raj S">]>, #<Nokogiri::XML::Text:0x253b2dc "\n ">, #<Nokogiri::XML::Element:0x253b2ac name="headline" children=[#<Nokogiri::X
ML::Text:0x253b0e4 "Senior Software Engineer at AB Innovative Software Pvt. Ltd">]>, #<Nokogiri::XML::Text:0x253b00c "\n ">, #<Nokogiri::XML:
:Element:0x253afdc name="site-standard-profile-request" children=[#<Nokogiri::XML::Text:0x253ae14 "\n ">, #<Nokogiri::XML::Element:0x253ade
4 name="url" children=[#<Nokogiri::XML::Text:0x253ac1c "http://www.linkedin.com/profile?viewProfile=&key=78718913&authToken=XE_V&authType=name
&trk=api*a178337*s186521*">]>, #<Nokogiri::XML::Text:0x253ab44 "\n ">]>, #<Nokogiri::XML::Text:0x253aa6c "\n">]>]>>
How to parse this into a hasmap or to a string?
Pleas help me as i am new to rails.
Get the Nokogiri XML document
Convert the Nokogiri XML Document to a Hash:
https://stackoverflow.com/a/10144623/405017
If you want a different form for you Hash, then you should have specified your desired output in the question. :p There are a very large number of ways to represent an XML document as a hash.