This project is a Flask-Ask-based web application, providing a Voice User Interface to Vermont Public Radio programming.
Using Alexa AudioDirectives, it allows users to:
- play episodic (podcast) VPR programming
- stream live VPR programming including:
- VPR Live Stream
- VPR Jazz
- VPR Classical
- VPR Replay
It's easiest to run the skill in Heroku using the provided Procfile. Follow the getting started on Heroku with Python documentation online.
FLASK_SECRET_KEY
- Sets the
SECRET_KEY
value on the Flask app. See http://flask.pocoo.org/docs/0.12/config/#builtin-configuration-values
- Sets the
DISABLE_ASK_VERIFY_REQUESTS
(optional)- True - Flask-Ask will not confirm the request originated from Amazon (allowing you to test from any system)
- False - [Default] all requests are checked to see if they originate from Amazon
REDIS_URL
(optional)- A Heroku-like URL to a Redis instance to use for Alexa session caching.
- Note: Heroku-like means following the
redis://h:..
pattern. If you add a Redis add-on via Heroku, it should automatically set this environment variable on your dyno.
The project is logically split out across a few modules:
- webapp.py - main web application logic, including Alexa Skills Kit intent handling
- programs.py - VPR programming data model, integration to VPR's podcast site for lookups
- wsgi.py - WSGI setup for running in something like gunicorn
Note: All Alexa requests target the /ask
path on the application.
The project is built to work with both Python 2.7 and Python 3.6. If you'd like to hack on the source code, it's recommended to use a Python virtual environment.
- Clone the project:
git clone https://github.com/vprnet/vpr-alexa-skill
- Install dependencies:
pip install -r requirements.txt
- Verify you project through testing!
- Using tox:
tox
- Using pytest directly:
pytest
The project uses the pytest framework, keeping testing simple and straightforward.
- Tests are located in ./tests
- Sample Alexa JSON requests are available in ./tests/fixtures