Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4620244
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:32:03+00:00 2026-05-22T02:32:03+00:00

I am using the linkedin gem https://github.com/pengwynn/linkedin I authorize using Omniauth and store the

  • 0

I am using the linkedin gem https://github.com/pengwynn/linkedin

I authorize using Omniauth and store the access token and secrets.

I then authorize by access with the client.

I appear to get something useful when I type client.profile — but it looks like mostly Nokogiri but in a LinkedIn::Profile class.

How do I specifically access fields, and will I be able to use method calls from the View in rails or do I need to do all the parsing in the controller and pass those values to the View from there.

Example of how to access the profile image url, title, name, company that sort of thing once I have established client.profile would be great.

When I use the (:fields =>) I get back something like this:

#<LinkedIn::Profile:0xb682c72c @doc=#<Nokogiri::XML::Document:0x..fdb41630a name="document" children=[#<Nokogiri::XML::Element:0x..fdb415fae name="person" children=[#<Nokogiri::XML::Text:0x..fdb415d88 "\n  ">, #<Nokogiri::XML::Element:0x..fdb415d24 name="picture-url" children=[#<Nokogiri::XML::Text:0x..fdb415aae "http://media.linkedis:

I just want the string associated with the node “picture-url”…how do I do that?

From controller:

7   `def show`
  8     @user = User.find(params[:id]) 
  9     @client = LinkedIn::Client.new(ENV["LINKEDIN_KEY"], ENV["LINKEDIN_SECRET"]) 
 10     @client.authorize_from_access(@user.atoken, @user.asecret) 
 11     @client.profile(:id => @user.uid, :fields => ["picture-url", "headline"]) 
 12     
 13   end 

New error:

undefined method `downcase' for nil:NilClass

Here is a related question: “https://stackoverflow.com/questions/5821549/how-do-i-pass-a-a-tag-through-ruby-to-linkedin-using-the-gem“

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:32:04+00:00Added an answer on May 22, 2026 at 2:32 am

    I did it by adding:

    client.profile(:fields => [:positions]).positions
    

    This would then allow me to access specific positions or fields without going into the raw xml, just using the methods in the gem. The gem works nicely once I get the format…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the PEAR OAuth Class to access the LinkedIn developer API and I've
I'm using PECL OAuth with LinkedIn because it is working fine with Twitter and
I am using Spring MVC and want to develop a website that uses REST
It's working elsewhere on the site using the same CSS as far as I
I'm building my website to pull out my own linkedin profile info. And it
Using Visual Studio 2010 C++. I have a project which uses MFC and I
Using active record, how can I return the results for a model if they
using CodeIgniter normally one has to specify the controllers in the config/routes.php file. This
Using Lift's json parser, how can I output parsed json objects into a template?
using ASP.NET MVC, I have a Model, to which I'm attaching attributes so that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.