lib/lita/handlers/onewheel_election_cnn.rb in lita-onewheel-election-cnn-0.1.0 vs lib/lita/handlers/onewheel_election_cnn.rb in lita-onewheel-election-cnn-0.1.1
- old
+ new
@@ -18,11 +18,11 @@
results = JSON.parse(RestClient.get('http://data.cnn.com/ELECTION/2016/full/P.full.json'))
results['candidates'].each do |candidate|
candidate_str = "#{candidate['fname']} #{candidate['lname']}: "
candidate_str += "WINNER! " if candidate['winner']
- candidate_str += "#{candidate['pctDecimal']}%, #{candidate['vpct']}% of precincts reporting."
+ candidate_str += "#{candidate['pctDecimal']}%, (#{candidate['votes']})"
response.reply candidate_str
end
end
def election_by_state(response)
@@ -34,10 +34,10 @@
results['races'].each do |race|
if race['state'].downcase == state.downcase
race['candidates'].each do |candidate|
candidate_str = "#{state} - #{candidate['fname']} #{candidate['lname']}: "
candidate_str += "WINNER! " if candidate['winner']
- candidate_str += "#{candidate['pctDecimal']}%, #{candidate['vpct']}% of precincts reporting."
+ candidate_str += "#{candidate['pctDecimal']}%, (#{candidate['votes']})"
response.reply candidate_str
end
end
end
end