https://github.com/bendog/fuelwatch_demo
Demo code from the Fuelwatch Workshop class
https://github.com/bendog/fuelwatch_demo
Last synced: about 1 year ago
JSON representation
Demo code from the Fuelwatch Workshop class
- Host: GitHub
- URL: https://github.com/bendog/fuelwatch_demo
- Owner: bendog
- Created: 2020-01-24T06:54:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-24T07:13:07.000Z (over 6 years ago)
- Last Synced: 2025-02-08T03:44:45.919Z (over 1 year ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fuel watch workshop demo code
Some demo examples of python code from the 2020 fuel watch workshop night 1
## requirements
```pip install requests feedparser```
to run app.py you will also need flask
```pip install flask```
## files
### get_feed.py
this file retrieves the RSS feed and outputs the content to `output.json`.
if output.json exists, it will read that version rather than fetch the content again.
I mostly added this feature so i could test the code whilst i was offline on a plane.
### fuelwatch.py
this file will output the conent to a very simple html table, using string substitution
to run this script type `python fuelwatch.py`
then check the file `output.html`
### jinjary.py
this file will do the same thing, but rather than pure python, it uses the jinja2 templating library, to insert the 'context' into a html template
to run this script type `python jinjary.py`
then check the file `output.html`
### app.py
this file uses the same jinja2 template, but will run a flask web app to server them.
to run flask type
`python -m flask run`
then go to in your web browser