Use state abbreviations in notifications
berkowitze opened this issue · comments
Is your feature request related to any of these? We are not pursuing these at the moment.
No it is not :)
- graphs and data visualizations
- projections and regression models
- additional data added to the top of the page
- changes to the hurdle rate. please see #194; the hurdle rate is not incorrect.
This isn't really a big deal, but currently if enough states add votes you can't necessarily see all of them in the notification:
Proposal: Add a stateToAbbreviation
object that translates state name to state abbreviation (i.e. "Pennsylvania"
-> "PA"
), and in the new Notification
call map over latestMetadata.states_updated
using that object. The result would be a notification with text "New ballots counted in: PA, GA, AZ".
Happy to open a PR to do this (already have the code though don't know how to compile the template files to test it).
Sure! We'd absolutely accept a PR to implement this. You can test by doing the following:
pip install -r requirements.txt
(you may want to set up a virtualenv)./print-battleground-state-changes
(this generates the HTML files)- Start a HTTP server with
python -m http.server
and open the HTML file in your browser from the server. - Edit the generated HTML file: change the
results_hash
and add one or more states to thestates_updated
array in thepage-metadata
JSON and save the file. - The loaded HTML will be auto-refreshing and should pick up the changes and fire the notification.
Let me know if you have any questions or trouble with that!
Awesome!
PR: #379