Created
November 1, 2016 17:53
-
-
Save everypoliticianbot/3489e1c766b50f6915e8c096764069d2 to your computer and use it in GitHub Desktop.
Use EveryPolitician gem to determine youngest member of UK legislature
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
import 'everypolitician' | |
house_of_commons = EveryPolitician::Index.new.country('UK').legislature('commons') | |
house_of_commons.legislative_periods.map { |t| | |
y = t.memberships.map(&:person).sort_by(&:birth_date).last | |
[t.id, t.start_date.to_s, y.gender, y.name, | |
((t.start_date — Date.parse(y.birth_date) / 365.25).round(1) ] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment