Get stock quotes in Twitter. (@slashStock GOOG)
The bot understand commands in this format:
@slashStock SYMBOL TIME_SPAN
SYMBOL
- Any stock symbol. Can contain$
symbol. Can specify the exchange.TIME_SPAN
(optional) - Time span to pull the chart for.- Defaults to
1d
if not specifed - Possible values: one of
1d
,5d
,3m
,6m
,1y
,2y
,5y
,my
(max)
- Defaults to
- Amazon -
@slashStock AMZN
- Netflix -
Netflix is now in 190 countries. Damn! @slashStock $NFLX
- S&P 500 -
@slashStock SPY 5y
- Greece ETF -
@slashStock GREK 2y
Currently I'm running this bot on a 1GB DigitalOcean instance (Use that link to get a free VPS for 2 months). The bot is not resource-intensive and uses a couple dozen MBs of RAM.
- Python 2+
- pip
Create a file called config.py
that looks like config_example.py
. Fill in the necessary values.
For Twitter config:
- Register your app
- Get your app's key and secret.
- Create token and get the token and secret by running
oauth.py
Then, to run the bot:
$ pip install -r requirements.txt
$ python bot.py
Apache 2.0