Inspired by and based on the Denver Post’s Rockies Misery Index
Here's the new workflow for adding a Mets Misery Index widget to articles:
- Go to https://github.com/nydailynews/mets-misery-index#in-article-widgets . That will take you to the part of the page where the markup is for each of the three widgets: misery-injury, misery-poll and misery-index.
- Choose which of the three widgets you want and triple-click the line with that markup.
- You should have the line with the markup selected now. Copy it to your clipboard.
- In SNAP, edit the article you want to add the widget to. Then:
- Create a new HTML embed.
- Paste the contents of your clipboard into the field.
- It should look something like this:
<iframe id="misery-injury" scrolling="no" style="width: 100%; height: 310px; border: 0;" src="http://interactive.nydailynews.com/project/mets-misery-index/widget-injury-tracker.html"></iframe>
<iframe id="misery-poll" scrolling="no" style="width: 100%; height: 300px; border: 0;" src="http://interactive.nydailynews.com/project/mets-misery-index/widget-fan-misery.html"></iframe>
<iframe id="misery-index" scrolling="no" style="width: 100%; height: 190px; border: 0;" src="http://interactive.nydailynews.com/project/mets-misery-index/widget-misery.html"></iframe>
This is a python 3 app, make sure you have python 3 installed before continuing. brew install python3
on a mac.
- To create a virtual environment using python3, run something like
mkvirtualenv --python=/usr/local/bin/python3 MISERY
. - cd to the project root
pip3 install -r requirements.txt
If you don't have python 3 and virtualenv set up:
brew install python3
pip3 install virtualenv
pip3 install virtualenvwrapper
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
source /usr/local/bin/virtualenvwrapper.sh