Skip to content

nydailynews/mets-misery-index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inspired by and based on the Denver Post’s Rockies Misery Index

Production

In-article widgets

Here's the new workflow for adding a Mets Misery Index widget to articles:

  1. 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.
  2. Choose which of the three widgets you want and triple-click the line with that markup.
  3. You should have the line with the markup selected now. Copy it to your clipboard.
  4. In SNAP, edit the article you want to add the widget to. Then:
    1. Create a new HTML embed.
    2. Paste the contents of your clipboard into the field.
    3. 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>

Usage

How to set up a dev environment

This is a python 3 app, make sure you have python 3 installed before continuing. brew install python3 on a mac.

  1. To create a virtual environment using python3, run something like mkvirtualenv --python=/usr/local/bin/python3 MISERY.
  2. cd to the project root
  3. pip3 install -r requirements.txt

If you don't have python 3 and virtualenv set up:

  1. brew install python3
  2. pip3 install virtualenv
  3. pip3 install virtualenvwrapper
  4. VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
  5. source /usr/local/bin/virtualenvwrapper.sh