Script to update stocks for trello board
# This will update the stock tickers of all subscribed lists.
npm run update-board
# Run all unit tests.
npm run test
Make sure you have the latest version of node.js (developed wth v8)
# Update node to latest version.
npm install -g n
n latest
# Install dependencies.
npm install
First log into your trello account then visit this URL:
It will contain two keys: your trello api key and your OAuth token. You will need both of these fields as well as generate an API_TOKEN.
Secondly get your trello board id from a network request. It will be located
in the response body for the /Members/me
API call or /boards
.
Look at the boards field and you should find it.
{
"boards": [
{
"id": "THIS IS WHAT YOU WANT",
"name": "stocks",
"shortLink": "ignore",
"shortUrl": "ignore",
"url": "ignore"
}
]
}
Then create a server/secrets.json
file from secrets.example.json
and fill out
those fields.
Once that is set up, run the following to check that the Trello setup is working. You should see a JSON reponse body of your board details. Confirm that it is the correct board.
Once that is complete you can run this script to update all tickers via data from the unofficial Robinhood API.
Running script
npm run update
https://github.com/sanko/Robinhood/blob/master/Quote.md
https://api.robinhood.com/quotes/PYPL/
https://api.robinhood.com/quotes/?symbols=MSFT,FB,TSLA
https://api.robinhood.com/quotes/historicals/?symbols=MSFT,FB,TSLA&interval=week
https://api.robinhood.com/quotes/historicals/?symbols=MSFT,FB,TSLA&interval=day
https://api.robinhood.com/fundamentals/PYPL/
https://api.robinhood.com/fundamentals/?symbols=PYPL
https://api.robinhood.com/instruments/4df42b1f-8f39-49ae-bbfb-831c43931218/