lib/lita/handlers/onewheel_election_cnn.rb in lita-onewheel-election-cnn-3.5.0 vs lib/lita/handlers/onewheel_election_cnn.rb in lita-onewheel-election-cnn-3.6.0
- old
+ new
@@ -31,11 +31,11 @@
results = JSON.parse(RestClient.get('http://data.cnn.com/ELECTION/2016/full/P.full.json'))
response.reply "United States 2016 Presidential Election, #{results['races'][0]['pctsrep']}% reporting."
results['candidates'].each do |candidate|
candidate_str = "#{candidate['fname']} #{candidate['lname']}: "
- candidate_str += "#{candidate['pctDecimal']}%, #{candidate['evotes']} electoral votes."
+ candidate_str += "#{candidate['pctDecimal']}%, #{candidate['cvotes']} popular votes, #{candidate['evotes']} electoral votes."
candidate_str += " WINNER! " if candidate['winner']
Lita.logger.debug "Replying with #{candidate_str}"
response.reply candidate_str
end
end
@@ -51,10 +51,10 @@
state_reply = "#{state}, #{race['evotes']} electoral votes, #{race['pctsrep']}% reporting"
response.reply state_reply
Lita.logger.debug "Replying with #{state_reply}"
race['candidates'].each do |candidate|
candidate_str = "#{candidate['fname']} #{candidate['lname']}: "
- candidate_str += "#{candidate['pctDecimal']}%"
+ candidate_str += "#{candidate['pctDecimal']}%, #{candidate['cvotes']} popular votes"
candidate_str += " WINNER! #{candidate['evotes']} electoral votes." if candidate['winner']
Lita.logger.debug "Replying with #{candidate_str}"
response.reply candidate_str
end
end