Skip to content

Instantly share code, notes, and snippets.

@jpmckinney
Last active August 29, 2015 14:00
Show Gist options
  • Save jpmckinney/11226515 to your computer and use it in GitHub Desktop.
Save jpmckinney/11226515 to your computer and use it in GitHub Desktop.
Evaluate the popularity of company statuses.
require 'open-uri'
require 'nokogiri'
status = Hash.new(0)
Nokogiri::HTML(open('https://opencorporates.com/')).css('#facets a').each do |a|
Nokogiri::HTML(open("https://opencorporates.com#{a[:href]}")).css('.current_status li').each do |li|
status[li.at_css('a').text.strip] += Integer(li.at_css('span').text.strip.gsub(',', ''))
end
end
21802612 Active
7109401 Dissolved
6026023 Inactive
1255505 Suspended
1070539 In Business
1045528 Registered
1008981 Inactive Dissolution By Pro...
892715 Immatriculée
701182 Struck Off
584696 Cancelled
554056 Active/Compliance
529034 Automatic Dissolution
506068 Funcţiune, Certificat De înma...
473407 Automated Administrative Diss...
448349 Funcţiune
418488 Radiée D'office
412124 Active Proposal To Strike Off
387972  Active
347303 Forfeited
344662 Inactive Dissolution
342950 Live
341895 Admin. Dissolved
337528 Good Standing
274110 Liquidation
271165 Deregistration Process
250732 Radiée Sur Demande
241571 Withdrawn
235694 Strike Off
233442  Defunct
221038 Inactive Dissolved (Adminis...
201369 Revoked
200046 Normal
194129 Dead
189269 Defunct
174863 Terminated
148418 întrerupere Temporară De Acti...
147804 Unknown
147650 Radiée D'office Suite à Une D...
143275 In Existence
140216 Dormant
128169 Active/Noncompliance
120821 Otc Suspension
120055  Liquidated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment