Created
November 1, 2016 16:52
-
-
Save everypoliticianbot/1ec3e150be263024fd884db5b2f441ce to your computer and use it in GitHub Desktop.
print name, party, twitter handle for given country
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
#!/usr/bin/env ruby | |
require 'everypolitician' | |
c = 'Ecuador' # or try 'Canada' or 'UK' or ... | |
legislature = EveryPolitician::Index.new.country(c).lower_house | |
legislature.latest_term.memberships.each do |m| | |
puts "#{m.person.name} (#{m.party.name}): @#{m.person.twitter || '?'}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the everypolitician Gem to iterate over all members of a legislature, printing out information including Twitter handles. Note that by default the gem is getting the most recent data from EveryPolitician's data.