Last active
July 15, 2017 09:41
-
-
Save tmtmtmtm/c4a24ecd94c3025124ac00b464976ae2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POSITION_HELD = 'P39' | |
START_DATE = 'P580' | |
CONSTITUENCY = 'P768' | |
PARTY = 'P4100' | |
ELECTED_IN = 'P2715' | |
SOURCE = 'S143' | |
TWFY = 'Q7783633' | |
TERM_MEMBERSHIP = 'Q30524710' # Member of the 57th Parliament of the UK | |
ELECTION = 'Q25052149' # GE 2017 | |
def day(str) | |
'+%sT00:00:00Z/11' % str | |
end | |
mems = Everypolitician::Index.new.country('UK').lower_house.latest_term.memberships | |
mems.each do |mem| | |
puts [ | |
mem.person.wikidata, | |
POSITION_HELD, TERM_MEMBERSHIP, | |
PARTY, mem.on_behalf_of.wikidata, | |
CONSTITUENCY, mem.area.wikidata, | |
START_DATE, day('2017-06-08'), # day(mem.start_date || mem.term.start_date), | |
ELECTED_IN, ELECTION, | |
SOURCE, TWFY | |
].join("\t") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: