leesei / heroku-hkstock.py

[DEPRECATED] Service that parse stock info from website to JSON.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Heroku app: heroku-hkstock (python)

Service that parse stock quotes from website to JSON.

This app is DEPRECATED by the Node.js version.
It now serves as a scraper reference for the various websites.

Usage

git clone https://github.com/leesei/heroku-hkstock.py.git
heroku apps:create NAME
git push heroku master
heroku addons:add rediscloud
heroku addons:add newrelic:stark
heroku config:set NEW_RELIC_APP_NAME="NAME"
heroku config:set TZ="heroku"

Endpoints

  • /
    Test Redis usage and timezone
  • /debug
    List scrapers
  • /rtq?symbol=symbol[&src=scraper]
    Quote service

Local server

Prerequisite (do these once only):

virtualenv env
. env/bin/activate
pip install -r requirements.txt  # rerun if updated

lxml cannot be compiled on my machine

Run local server:

. env/bin/activate
source .env.source
foreman start web -f Procfile.local

TODO

  • Worker is not finished (Worker act as backend to scrape and push results to redis)
  • multiple request handlers (using unicorn?)
  • console app

About

[DEPRECATED] Service that parse stock info from website to JSON.

License:MIT License


Languages

Language:Python 100.0%