lib/lita/handlers/onewheel_election_cnn.rb in lita-onewheel-election-cnn-3.0.2 vs lib/lita/handlers/onewheel_election_cnn.rb in lita-onewheel-election-cnn-3.1.0
- old
+ new
@@ -25,11 +25,11 @@
Lita.logger.debug 'Getting election data'
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 += "#{candidate['pctDecimal']}%"
- candidate_str += " WINNER! #{candidate['evotes']} electoral votes." if candidate['winner']
+ candidate_str += "#{candidate['pctDecimal']}%, #{candidate['evotes']} electoral votes."
+ candidate_str += " WINNER! " if candidate['winner']
Lita.logger.debug "Replying with #{candidate_str}"
response.reply candidate_str
end
end