Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 43 lines (37 sloc) 1.68 KB
#!/usr/bin/ruby
# Produce initial JSON for a hard-coded list of coalition members
# Data from http://fi.wikipedia.org/wiki/Suomen_valtioneuvosto
# and http://en.wikipedia.org/wiki/Cabinet_of_Finland
require 'json'
info = [
[73, 'Stubb', ['2014-06-24', ], %w(kok sd vihr r kd)],
[72, 'Katainen', ['2011-06-22', '2014-06-24'], %w(kok sd vas vihr r kd)], # TODO vas left on
[71, 'Kiviniemi I', ['2010-06-22', '2011-06-22'], %w(kesk kok vihr r)],
[70, 'Vanhanen II', ['2007-04-19', '2010-06-22'], %w(kesk kok vihr r)],
[69, 'Vanhanen I', ['2003-07-26', '2007-04-19'], %w(kesk kok vihr r)],
[68, 'Jäätteenmäki I', ['2003-04-17', '2003-06-19'], %w(kesk kok vihr r)],
[67, 'Lipponen II', ['1999-04-15', '2003-04-17'], %w(sd kok r vas vihr)], # TODO vihr left on 2002-05-31
[66, 'Lipponen I', ['1995-04-13', '1999-04-15'], %w(sd kok r vas vihr)],
[65, 'Aho I', ['1991-04-26', '1995-04-13'], %w(kesk kok r kd)], # NB kd was skl then
[64, 'Holkeri I', ['1987-04-30', '1991-04-26'], %w(kok sd r ps )], # NB ps as SMP
]
orgs = info.each_with_object({}) { |(no, name, dates, members), h|
h[no] = {
:id => "popit.eduskunta/government/#{no}",
:name => "Government #{no}",
:other_names => [{ :name => name }],
:classification => "coalition",
:memberships => members.collect { |p|
{
:role => 'government',
:member => {
:@type => "Organization",
:id => "popit.eduskunta/party/#{p}",
},
}
},
:founding_date => dates[0],
}
h[no][:dissolution_date] = dates[1] if dates[1]
}
puts JSON.pretty_generate(orgs.values)
You can’t perform that action at this time.