Interactive map of restaurants in Sydney that have food penalties
Python HTML CSS JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
public
views
.nvmrc
README.md
package.json
server.js
spider.py
spider_prosecutions_pages.py

README.md

BadFood

BadFood shows a map of restaurants in Sydney that have been given a penalty from The Department of Primary Industries Food Authority, specifically from this public penalty notice list.

Data is scraped using a spider with python's scrapy and stored in a remote mongodb and served as a NodeJs+Express+EJS server on Heroku.

Build

Python's scrapy: pip install scrapy

Node: nvm install && npm install

Run

Crawl the data and output it as JSON, run the spider: scrapy runspider spider.py -o output.json

Import the data to a remote host:

mongoimport -h mongohost -d dbname -c collection -u username -p password --file output.json --jsonArray

Export the google maps API URL (Including the key) as an environment variable (or as a config var on Heroku):

export APIKEY="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&callback=initMap"

and similarly the mongodb url, for example with mlab:

export MONGOURL=mongodb://username:password@12345.mlab.com:55491/db

Contribute

  • Pull requests are accepted.
  • Thanks to Deedee lee for the BadFood emoji logo