Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted by Anthony ( 14 years ago )
require 'rubygems'
require 'nokogiri'
require 'hpricot'

class LinkController < ApplicationController
  def callback
    client = LinkedIn::Client.new("cus7tde3g4pe", "jKf6ZYgf8JhMoIJ4")
   
    if session[:atoken].nil?
      
      pin = params[:oauth_verifier]
      atoken, asecret = client.authorize_from_request(session[:rtoken], session[:rsecret], pin)
      session[:atoken] = atoken
      session[:asecret] = asecret
    else
      
      client.authorize_from_access(session[:atoken], session[:asecret])
    end
    
     @profile = client.profile
     @connections = client.connections
     @currnetStatus = client.current_status;
     
     @davidb = client.profile&#40;:fields => [:positions]&#41;.positions
     @company = @davidb.XPath("//position/company").first.text
    
    puts client.current_status.to_s #works
    puts "printing position information"
    #puts client.profile&#40;:fields => [:positions]&#41;.positions.inspect.to_s
   
  end
end

 

Revise this Paste

Your Name: Code Language: