Giter VIP home page Giter VIP logo

finabot's Introduction

Finabot - Telegram bot

Example Output

Finabot on Telegram (or command-line mode!) looks something like this when running command /latest. Finabot uses Yahoo Finance API so all ticker symbols must use the same format as Yahoo Finance uses. For example, in Nasdaq OMX Helsinki ticker symbols use .HE in the end, such as WITTED.HE or KEMPOWR.HE.

If the market is open, ticker symbol is ALL-CAPS, otherwise it's all lowercase.

msft    338.37  2.31% ๐ŸŸข
trow    126.79  8.27% ๐ŸŸข
vz       34.03 -1.43% ๐Ÿ”ด
WITTED    3.05  1.32% ๐ŸŸข
KEMPOW   40.87 -0.10% ๐Ÿ”ด
tsla    266.44  4.20% ๐ŸŸข

Current status

  • Please understand that this is just an experimental bot, run this at your own risk
  • It is completely under mercy of Yahoo Finance API
  • Works on just channel per bot (and fills my use case perfectly)
  • Code is just one big file
  • Class Finabot has just too many responsibilities
  • Uses Yahoo Finance API through basic_yahoo_finance gem
  • Not tested on Telegram channels
  • Probably works just on happy case path
  • It does not have any error handling, it just crashes

How to run this

Running locally

If you want to run this locally without connecting to Telegram, use --cli option.

    $ ruby finabot.rb --cli

or running from command-line

    $ ruby finabot.rb /help
    $ ruby finabot.rb /add WITTED.HE
    $ ruby finabot.rb /latest
    $ ruby finabot.rb /info WITTED.HE

Same commands work, so start with /help.

Running as Telegram bot

  • Create the bot on Telegram Telegram Bots
  • Grab the Telegram API token
  • Make the bot Inline so it replies on the group (like Irc bots back in the day)
  • Invite the bot to a channel
  • Start the finabot with command-line argument --telegram
    $ API_TOKEN=<your-telegram-api-token> ruby finabot.rb --telegram
  • Test with /help command, type it on the group and the bot should print the list of available commands. Remember, you run the bot at your own risk.

Persisted Ticker Symbols

When starting the bot, it loads the ticker symbols from tickers.txt. Finabot saves the ticker symbols into same file when ticker symbols are added or removed.

finabot's People

Watchers

Tuomas Jomppanen 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.