Skip to content

Latest commit

 

History

History
109 lines (86 loc) · 3.1 KB

README.md

File metadata and controls

109 lines (86 loc) · 3.1 KB

NewsBot

A Discord bot that frequently scrape stock market news.

Table of Contents

Discord Commands

These command must be prefix with command characters:

  • ping: ping bot
  • register: register a channel for notification
  • unregister: unregister a channel
  • run: start scrape & notify loop
  • stop: stop loop
  • save: scrape & save news to database; use this to intialize bot after restarting service
  • is-running check whether the bot is running
  • load-config load new config files

Config

Discord Config

  • command: command to invoke the bot; ex: >mna-ping
  • token: bot token
  • request: request when scraping webpage
  • timer_interval: how often we scrape

Publisher Config

Contains a dictionary of configuration for publishers (newspaper).

  • [key] Publishers: list of publishers for scraping
  • domain: url domain of newspaper
  • url: url of scraping webpage
  • table: name of table in database
  • articles_path: css path to list of news articles
  • title_path: css path from articles_path to title of articles
  • link_path: css path from articles_path to href of articles
  • link_with_domain: (boolean) true if the link has domain url in it; if false, the bot will append the domain before saving to database

Publisher Templates Checklist

Mergers n' Acquisition:

  • SeekingAlpha
  • FT
  • BusinessWire
  • Reuters
  • TheStreet
  • NewsNow
  • MarketWatch
  • BizJournals

Short:

  • Citron Research
  • Hindenburg Research
  • Muddy Water Research
  • Spruce Point Research
  • White Diamond Research
  • JCapital Research
  • Shadowfall

How to Install

  1. Create directories: build, config, database
  2. Run: npm install
  3. Run: npm run tsc
  4. Create config files: (examples in template directory)
    • bot_config.json
    • publisher_config.json
  5. Create .service file (example in template directory)
  6. Run service

🔰 Commit Emoji Guide

Emoji Meaning
🎉 Initial Commit
🚀 Release
Revert Changes
🐛 Bugfix
📦 Dependency
Deprecation
📖 Documentation
Features
🚧 In-Progress
Performance
♻️ Refactoring
🔒 Security
🧪 Tests
📝 Typos
💄 UI / Cosmetic
🔖 Version