https://github.com/dethada/reddit-ticker-scrapper
Search reddit for the most mentioned tickers.
https://github.com/dethada/reddit-ticker-scrapper
cryptocurrency reddit stocks
Last synced: over 1 year ago
JSON representation
Search reddit for the most mentioned tickers.
- Host: GitHub
- URL: https://github.com/dethada/reddit-ticker-scrapper
- Owner: Dethada
- License: gpl-3.0
- Created: 2021-03-30T09:11:43.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-04T14:56:13.000Z (about 5 years ago)
- Last Synced: 2025-02-23T03:54:45.457Z (over 1 year ago)
- Topics: cryptocurrency, reddit, stocks
- Language: Python
- Homepage:
- Size: 198 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reddit Ticker Scrapper 🚀
[](https://www.gnu.org/licenses/gpl-3.0) [](https://pycqa.github.io/isort/) [](https://github.com/psf/black)
Search a given subreddit for the most mentioned tickers.
## Setup 🔨
### Prerequisites
Install poetry (Linux)
```bash
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
```
Install poetry (Windows)
```bash
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
```
### Install Dependencies
```bash
poetry install --no-dev
```
### Reddit API Setup
Follow this guide at
https://github.com/reddit-archive/reddit/wiki/OAuth2#getting-started to get your `CLIENT_ID` and `CLIENT_SECRET`. Then create a file named `.env` and put the following content.
```
CLIENT_ID=''
CLIENT_SECRET=''
```
## Usage 📖
```
➜ poetry run ./reddit_ticker_scrapper/reddit_ticker_scrapper.py --help
Usage: main.py [OPTIONS] SUBREDDIT
Search SUBREDDIT for most mentioned tickers.
Options:
-p, --post-limit INTEGER RANGE Number of posts to parse.
-c, --comment-limit INTEGER RANGE
Number of comments to parse in each post. -1
to parse all comments, 0 to parse no
comments.
-n, --num-top-tickers INTEGER RANGE
Number of top tickers to print.
-e, --excluded PATH Text file containing words that are excluded
because they are mistaken as tickers.
-t, --tickers PATH CSV containing all tickers.
-o, --output PATH The filename of the csv of ticker counts.
--help Show this message and exit.
```
### Example
```
➜ poetry run ./reddit_ticker_scrapper/reddit_ticker_scrapper.py wallstreetbets
Searching r/wallstreetbets...
Ticker Company Frequency
GME GameStop Corporation Common Stock 341
PLTR Palantir Technologies Inc. Class A Common Stock 105
RKT Rocket Companies Inc. Class A Common Stock 88
AMC AMC Entertainment Holdings Inc. Class A Common Stock 37
BB BlackBerry Limited Common Stock 33
MS Morgan Stanley Common Stock 13
TSLA Tesla Inc. Common Stock 13
VIAC ViacomCBS Inc. Class B Common Stock 12
CS Credit Suisse Group American Depositary Shares 11
IT Gartner Inc. Common Stock 10
```
### Crypto Tickers Example
To find crypto tickers supply the crypto tickers csv via the `-t` option.
```
➜ poetry run ./reddit_ticker_scrapper/reddit_ticker_scrapper.py -t data/crypto_tickers.csv SatoshiStreetBets
Searching r/SatoshiStreetBets...
Ticker Coin Name Frequency
GET Guaranteed Entrance Token 23
BSC BowsCoin 22
ETH Ethereum 18
NFT NFT 18
STPT STP Network 11
HOGE Hoge Finance 10
UBX UBIX Network 9
BNB Binance Coin 8
BTT BitTorrent 8
BOG Bogcoin 7
```
#### Refreshing Crypto Tickers
Run `poetry run ./get_crypto_tickers.py`, it will pull the latest crypto tickers and write to `data/crypto_tickers.csv`.