GithubHelp home page GithubHelp logo

cristhiandick / stock-quote-slackbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nosajgithub/stock-quote-slackbot

0.0 2.0 0.0 13 KB

Slackbot that retrieves stock quotes from Yahoo Finance for a given ticker symbol

License: MIT License

Jupyter Notebook 0.65% Python 99.35%

stock-quote-slackbot's Introduction

stock-quote-slackbot

A slackbot that retrieves stock quote information from Yahoo Finance given a ticker symbol in Slack.

Background

Stockbot is Slack's Python-based real-time messaging bot wrapped around Łukasz Banasiak's Python wrapper for the Yahoo Finance API.

Usage

There are two ways to use stockbot. The first is to input the trigger word ('quote' by default) and one or more stock tickers. You'll get back a separate reply for each stock listed.

The second usage is to enter the word 'range', a ticker symbol, and a start and end date. Stockbot will return the average stock price over that date range.

In both cases, the trigger word must be the first word in the message. It is not case sensitive.

Example Usage

>>> quote GOOG YHOO
Stock​: 'GOOG'
Current Price​: $742.60
Day Range​: $741.27 - $754.93
52 Wk Range​: $486.23 - $762.71
YoY Change​: +39%
Market Cap​: $510.70B
 
Stock​: 'YHOO'
Current Price​: $33.81
Day Range​: $32.85 - $33.83
52 Wk Range​: $27.20 - $51.68
YoY Change​: -33%
Market Cap​: $31.93B

>>> range yhoo 2014-11-30 2015-11-30
The average price for 'YHOO' from 2014-11-30 to 2015-11-30 is: $40.41

Dependencies

Installation

  1. Download stockbot
git https://github.com/NosajGithub/stock-quote-slackbot.git
cd stock-quote-slackbot
  1. Install dependencies
pip install -r requirements.txt
  1. Configure rtmbot (Slack instructions.) Go to Slack integrations, make a new Slackbot, and grab the token. You get to choose your bot's name and icon. Also, pick a trigger word in the rtmbot.conf file.
cp example-config/rtmbot.conf .
vi rtmbot.conf
SLACK_TOKEN: "xoxb-11111111111-222222222222222"
TRIGGER_WORD: "quote"

  1. Run it! (You've got to keep it running as long as you want to use it; something like nohup might be helpful.)
  python rtmbot.py

stock-quote-slackbot's People

Contributors

nosajgithub avatar cristhiandick avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.