Skip to content

Instantly share code, notes, and snippets.

View landlessness's full-sized avatar

Brian S. Mulloy landlessness

View GitHub Profile
@paav-o
paav-o / linkedin_industry_codes.rb
Created January 11, 2012 15:06
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