Skip to content

Instantly share code, notes, and snippets.

@paav-o
Created January 11, 2012 15:06
Show Gist options
  • Select an option

  • Save paav-o/1595091 to your computer and use it in GitHub Desktop.

Select an option

Save paav-o/1595091 to your computer and use it in GitHub Desktop.
LinkedIn API Industry Codes
industry_codes = Hash.new
(1..150).each do |industry_code|
query = "http://api.linkedin.com/v1/company-search:(companies:(industry))?facet=industry,"+industry_code.to_s+"&count=1&format=json"
linkedin_response = JSON.parse(previously_acquired_access_token.get(query).body)
industry_codes[industry_code] = linkedin_response.try(:[], "companies").try(:[], "values").try(:[], 0).try(:[], "industry")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment