Compare commits

...

18 Commits

Author SHA1 Message Date
cdce16c29e Update README. 2025-08-26 15:16:53 +02:00
8238ca5352 Update README. 2025-08-26 15:15:36 +02:00
35577770dd words. 2025-08-26 14:55:45 +02:00
1c974595ef words. 2025-08-25 10:34:22 +02:00
6c444962ac More words. 2025-08-12 20:31:03 +02:00
ba9d81f453 New words. 2025-08-12 20:28:36 +02:00
b9767e4cfc Added option to add top parameter to view e.g. top 20 or top 50. 2025-08-08 22:53:15 +02:00
61c9aba952 Added better flair tools. 2025-08-08 22:44:46 +02:00
4012ff7bea Added words. 2025-08-08 22:38:04 +02:00
537a62988a More specific with versions. 2025-08-08 22:09:13 +02:00
9628883fa7 Wording. 2025-08-08 22:06:38 +02:00
673bc9cd6f Added two new words and changed URL from Yahoo finance to Marketwatch. 2025-08-04 20:23:01 +02:00
2aaab6673f Changed wording for price. 2025-08-01 22:00:45 +02:00
c392fbc366 Update version to 0.0.2. 2025-07-31 23:32:07 +02:00
1aaa2d70a0 Corrected mentions by adding unique contraint to avoid duplicates. 2025-07-31 23:25:10 +02:00
7fec7ec740 Correct url. 2025-07-31 22:57:31 +02:00
8ebaaf8b36 Refactored scraping logic. 2025-07-31 22:23:52 +02:00
2f43380970 Fixed exporting. 2025-07-31 22:23:09 +02:00
12 changed files with 779 additions and 762 deletions

View File

@@ -1,4 +1,4 @@
FROM node:24-bookworm-slim AS builder
FROM node:24.5.0-bookworm-slim AS builder
WORKDIR /usr/src/build
@@ -12,7 +12,7 @@ COPY static/css/input.css ./static/css/input.css
RUN npx tailwindcss -i ./static/css/input.css -o ./static/css/style.css --minify
FROM python:3.13.5-slim
FROM python:3.13.6-slim
EXPOSE 5000

516
README.md
View File

@@ -1,336 +1,308 @@
# rstat - Reddit Stock Analyzer
<div align="center">
A powerful, installable command-line tool and web dashboard to scan Reddit for stock ticker mentions, perform sentiment analysis, generate insightful reports, and create shareable summary images.
# RSTAT — Reddit Stock Analyzer
## Key Features
Scan Reddit for stock ticker mentions, score sentiment, enrich with price/market cap, and explore the results in a clean web dashboard. Automate shareable images and post them to Reddit.
* **Dual-Interface:** Use a flexible command-line tool (`rstat`) for data collection and a simple web dashboard (`rstat-dashboard`) for data visualization.
* **Flexible Data Scraping:**
* Scan subreddits from a config file or target a single subreddit on the fly.
* Configure the time window to scan posts from the last 24 hours (for daily cron jobs) or back-fill data from several past days (e.g., last 7 days).
* Fetches from `/new` to capture the most recent discussions.
* **Deep Analysis & Storage:**
* Scans both post titles and comments, differentiating between the two.
* Performs a "deep dive" analysis on posts to calculate the average sentiment of the entire comment section.
* Persists all data in a local SQLite database (`reddit_stocks.db`) to track trends over time.
* **Rich Data Enrichment:**
* Calculates sentiment (Bullish, Bearish, Neutral) for every mention using NLTK.
* Fetches and stores daily closing prices and market capitalization from Yahoo Finance.
* **Interactive Web Dashboard:**
* View Top 10 tickers across all subreddits or on a per-subreddit basis.
* Click any ticker to get a "Deep Dive" page, showing every post it was mentioned in.
* **Shareable Summary Images:**
* Generate clean, dark-mode summary images for both daily and weekly sentiment for any subreddit, perfect for sharing.
* **High-Quality Data:**
* Uses a configurable blacklist and smart filtering to reduce false positives.
* Automatically cleans the database of invalid tickers if the blacklist is updated.
</div>
## Project Structure
## Highlights
- CLI + Web UI: Collect data with `rstat`, browse it with `rstat-dashboard`.
- Smart ticker parsing: Prefer $TSLA/$AAPL “golden” matches; fall back to filtered ALL-CAPS words.
- Sentiment: VADER (NLTK) scores for titles and comments; “deep dive” averages per post.
- Storage: Local SQLite database `reddit_stocks.db` with de-duped mentions and post analytics.
- Enrichment: Yahoo Finance market cap + latest close fetched in batch and on-demand.
- Images: Export polished daily/weekly summary PNGs for subreddits or “overall”.
- Automation: Optional cron job plus one-command posting to Reddit with OAuth refresh tokens.
## Repository layout
```
reddit_stock_analyzer/
├── .env # Your secret API keys
├── requirements.txt # Project dependencies
├── setup.py # Installation script for the tool
├── subreddits.json # Default list of subreddits to scan
├── templates/ # HTML templates for the web dashboard
│ ├── base.html
│ ├── index.html
│ ├── subreddit.html
│ ├── deep_dive.html
│ ├── image_view.html
│ └── weekly_image_view.html
── rstat_tool/ # The main source code package
├── __init__.py
├── main.py # Scraper entry point and CLI logic
├── dashboard.py # Web dashboard entry point (Flask app)
├── database.py # All SQLite database functions
── ...
.
├── Dockerfile # Multi-stage build (Tailwind -> Python + gunicorn)
├── docker-compose.yml # Prod (nginx + varnish optional) + dashboard
├── docker-compose-dev.yml # Dev compose (local nginx)
├── requirements.txt # Python deps
├── setup.py # Installs console scripts
├── subreddits.json # Default subreddits list
├── reddit_stocks.db # SQLite database (generated/updated by CLI)
├── export_image.py # Generate shareable PNGs (Playwright)
├── post_to_reddit.py # Post latest PNG to Reddit
├── get_refresh_token.py # One-time OAuth2 refresh token helper
├── fetch_close_price.py # Utility for closing price (yfinance)
── fetch_market_cap.py # Utility for market cap (yfinance)
├── rstat_tool/
├── main.py # CLI entry (rstat)
├── dashboard.py # Flask app entry (rstat-dashboard)
├── database.py # SQLite schema + queries
── ticker_extractor.py # Ticker parsing + blacklist
│ ├── sentiment_analyzer.py # VADER sentiment
│ ├── cleanup.py # Cleanup utilities (rstat-cleanup)
│ ├── flair_finder.py # Fetch subreddit flair IDs (rstat-flairs)
│ ├── logger_setup.py # Logging
│ └── setup_nltk.py # One-time VADER download
├── templates/ # Jinja2 templates (Tailwind 4 styling)
└── static/ # Favicon + generated CSS (style.css)
```
## Setup and Installation
## Requirements
Follow these steps to set up the project on your local machine.
- Python 3.10+ (Docker image uses Python 3.13-slim)
- Reddit API app (script type) for read + submit
- For optional image export: Playwright browsers
- For UI development (optional): Node 18+ to rebuild Tailwind CSS
### 1. Prerequisites
* Python 3.7+
* Git
## Setup
1) Clone and enter the repo
### 2. Clone the Repository
```bash
git clone <your-repository-url>
git clone <your-repo>
cd reddit_stock_analyzer
```
### 3. Set Up a Python Virtual Environment
It is highly recommended to use a virtual environment to manage dependencies.
2) Create and activate a virtualenv
**On macOS / Linux:**
```bash
python3 -m venv .venv
source .venv/bin/activate
```
- bash/zsh:
```bash
python3 -m venv .venv
source .venv/bin/activate
```
- fish:
```fish
python3 -m venv .venv
source .venv/bin/activate.fish
```
**On Windows:**
```bash
python -m venv .venv
.\.venv\Scripts\activate
```
3) Install Python dependencies and commands
### 4. Install Dependencies
```bash
pip install -r requirements.txt
pip install -e .
```
### 5. Configure Reddit API Credentials
1. Go to the [Reddit Apps preferences page](https://www.reddit.com/prefs/apps) and create a new "script" app.
2. Create a file named `.env` in the root of the project directory.
3. Add your credentials to the `.env` file like this:
4) Configure environment
```
REDDIT_CLIENT_ID=your_client_id_from_reddit
REDDIT_CLIENT_SECRET=your_client_secret_from_reddit
REDDIT_USER_AGENT=A custom user agent string (e.g., python:rstat:v1.2)
```
Create a `.env` file in the repo root with your Reddit app credentials:
```
REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_client_secret
REDDIT_USER_AGENT=python:rstat:v1.0 (by u/yourname)
```
Optional (after OAuth step below):
```
REDDIT_REFRESH_TOKEN=your_refresh_token
```
5) One-time NLTK setup
### 6. Set Up NLTK
Run the included setup script **once** to download the required `vader_lexicon` for sentiment analysis.
```bash
python rstat_tool/setup_nltk.py
```
### 7. Set Up Playwright
Run the install routine for playwright. You might need to install some dependencies. Follow on-screen instruction if that's the case.
```bash
playwright install
```
6) Configure subreddits (optional)
### 8. Build and Install the Commands
Install the tool in "editable" mode. This creates the `rstat` and `rstat-dashboard` commands in your virtual environment and links them to your source code.
Edit `subreddits.json` to your liking. It ships with a sane default list.
## CLI usage (rstat)
The `rstat` command collects Reddit data and updates the database. Credentials are read from `.env`.
Common flags (see `rstat --help`):
- `--config FILE` Use a JSON file with `{"subreddits": [ ... ]}` (default: `subreddits.json`)
- `--subreddit NAME` Scan a single subreddit instead of the config
- `--days N` Only scan posts from the last N days (default 1)
- `--posts N` Max posts per subreddit to check (default 200)
- `--comments N` Max comments per post to scan (default 100)
- `--no-financials` Skip Yahoo Finance during the scan (faster)
- `--update-top-tickers` Update financials for tickers that are currently top daily/weekly
- `--update-financials-only [TICKER]` Update all or a single tickers market cap/close
- `--stdout` Log to console as well as file; `--debug` for verbose
Examples:
```bash
pip install -e .
```
The installation is now complete.
# Scan configured subs for last 24h, including financials
rstat --days 1
---
# Target a single subreddit for the past week, scan more comments
rstat --subreddit wallstreetbets --days 7 --comments 250
## Usage
# Skip financials during scan, then update only top tickers
rstat --no-financials
rstat --update-top-tickers
The tool is split into two commands: one for gathering data and one for viewing it.
# Update financials for all tickers in DB
rstat --update-financials-only
### 1. The Scraper (`rstat`)
This is the command-line tool you will use to populate the database. It is highly flexible.
**Common Commands:**
* **Run a daily scan (for cron jobs):** Scans subreddits from `subreddits.json` for posts in the last 24 hours.
```bash
rstat --config subreddits.json --days 1
```
* **Scan a single subreddit:** Ignores the config file and scans just one subreddit.
```bash
rstat --subreddit wallstreetbets --days 1
```
* **Back-fill data for last week:** Scans a specific subreddit for all new posts in the last 7 days.
```bash
rstat --subreddit Tollbugatabets --days 7
```
* **Get help and see all options:**
```bash
rstat --help
```
### 2. The Web Dashboard (`rstat-dashboard`)
This command starts a local web server to let you explore the data you've collected.
**How to Run:**
1. Make sure you have run the `rstat` scraper at least once to populate the database.
2. Start the web server:
```bash
rstat-dashboard
```
3. Open your web browser and navigate to **http://127.0.0.1:5000**.
**Dashboard Features:**
* **Main Page:** Shows the Top 10 most mentioned tickers across all scanned subreddits.
* **Subreddit Pages:** Click any subreddit in the navigation bar to see a dashboard specific to that community.
* **Deep Dive:** In any table, click on a ticker's symbol to see a detailed breakdown of every post it was mentioned in.
* **Shareable Images:** On a subreddit's page, click "(View Daily Image)" or "(View Weekly Image)" to generate a polished, shareable summary card.
### 3. Exporting Shareable Images (`.png`)
In addition to viewing the dashboards in a browser, the project includes a powerful script to programmatically save the 'image views' as static `.png` files. This is ideal for automation, scheduled tasks (cron jobs), or sharing the results on social media platforms like your `r/rstat` subreddit.
#### One-Time Setup
The image exporter uses the Playwright library to control a headless browser. Before using it for the first time, you must install the necessary browser runtimes with this command:
```bash
playwright install
# Update a single ticker (case-insensitive)
rstat --update-financials-only TSLA
```
#### Usage Workflow
How mentions are detected:
The exporter works by taking a high-quality screenshot of the live web page. Therefore, the process requires two steps running in two separate terminals.
- If a post contains any $TICKER (e.g., `$TSLA`) anywhere, we use “golden-only” mode: only $-prefixed tickers are considered.
- Otherwise, we fall back to filtered ALL-CAPS 25 letter words, excluding a large blacklist to avoid false positives.
- Title tickers attribute all comments in the thread; otherwise, we scan comments directly for mentions.
**Step 1: Start the Web Dashboard**
## Web dashboard (rstat-dashboard)
The web server must be running for the exporter to have a page to screenshot. Open a terminal and run:
Start the dashboard and open http://127.0.0.1:5000
```bash
rstat-dashboard
```
Leave this terminal running.
**Step 2: Run the Export Script**
Features:
Open a **second terminal** in the same project directory. You can now run the `export_image.py` script with the desired arguments.
- Overall top 10 (daily/weekly) across all subs
- Per-subreddit dashboards (daily/weekly)
- Deep Dive pages listing posts analyzed for a ticker
- Shareable image-friendly views (UI hides nav when `?image=true`)
**Examples:**
The dashboard reads from `reddit_stocks.db`. Run `rstat` first so you have data.
* To export the **daily** summary image for `r/wallstreetbets`:
```bash
python export_image.py wallstreetbets
```
## Image export (export_image.py)
* To export the **weekly** summary image for `r/wallstreetbets`:
```bash
python export_image.py wallstreetbets --weekly
```
Exports a high-res PNG of the dashboard views via Playwright. Note: the script currently uses `https://rstat.net` as its base URL.
* To export the **overall** summary image (across all subreddits):
```bash
python export_image.py --overall
```
#### Output
After running a command, a new `.png` file (e.g., `wallstreetbets_daily_1690000000.png`) will be saved in the images-directory in the root directory of the project.
## 4. Full Automation: Posting to Reddit via Cron Job
The final piece of the project is a script that automates the entire pipeline: scraping data, generating an image, and posting it to a target subreddit like `r/rstat`. This is designed to be run via a scheduled task or cron job.
### Prerequisites: One-Time Account Authorization (OAuth2)
To post on your behalf, the script needs to be authorized with your Reddit account. This is done securely using OAuth2 and a `refresh_token`, which is compatible with 2-Factor Authentication (2FA). This is a **one-time setup process**.
**Step 1: Get Your Refresh Token**
1. First, ensure the "redirect uri" in your [Reddit App settings](https://www.reddit.com/prefs/apps) is set to **exactly** `http://localhost:8080`.
2. Run the temporary helper script included in the project:
```bash
python get_refresh_token.py
```
3. The script will print a unique URL. Copy this URL and paste it into your web browser.
4. Log in to the Reddit account you want to post from and click **"Allow"** when prompted.
5. You'll be redirected to a `localhost:8080` page that says "This site cant be reached". **This is normal and expected.**
6. Copy the **full URL** from your browser's address bar. It will look something like `http://localhost:8080/?state=...&code=...`.
7. Paste this full URL back into the terminal where the script is waiting and press Enter.
8. The script will output your unique **refresh token**.
**Step 2: Update Your `.env` File**
1. Open your `.env` file.
2. Add a new line and paste your refresh token into it.
3. Ensure your file now contains the following (your username and password are no longer needed):
```
REDDIT_CLIENT_ID=your_client_id_from_reddit
REDDIT_CLIENT_SECRET=your_client_secret_from_reddit
REDDIT_USER_AGENT=A custom user agent string (e.g., python:rstat:v1.2)
REDDIT_REFRESH_TOKEN=the_long_refresh_token_string_you_just_copied
```
You can now safely delete the `get_refresh_token.py` script. Your application is now authorized to post on your behalf indefinitely.
### The `post_to_reddit.py` Script
This is the standalone script that finds the most recently generated image and posts it to Reddit using your new authorization.
**Manual Usage:**
* **Post the latest OVERALL summary image to `r/rstat`:**
```bash
python post_to_reddit.py
```
* **Post the latest DAILY image for a specific subreddit:**
```bash
python post_to_reddit.py --subreddit wallstreetbets
```
* **Post the latest WEEKLY image for a specific subreddit:**
```bash
python post_to_reddit.py --subreddit wallstreetbets --weekly
```
### Setting Up the Cron Job
To run the entire pipeline automatically every day, you can use a simple shell script controlled by `cron`.
**Step 1: Create a Job Script**
Create a file named `run_daily_job.sh` in the root of your project directory.
**`run_daily_job.sh`:**
```bash
#!/bin/bash
# CRITICAL: Navigate to the project directory using an absolute path.
# Replace '/path/to/your/project/reddit_stock_analyzer' with your actual path.
cd /path/to/your/project/reddit_stock_analyzer
# CRITICAL: Activate the virtual environment using an absolute path.
source /path/to/your/project/reddit_stock_analyzer/.venv/bin/activate
echo "--- Starting RSTAT Daily Job on $(date) ---"
# 1. Scrape data from the last 24 hours.
echo "Step 1: Scraping new data..."
rstat --days 1
# 2. Start the dashboard in the background.
echo "Step 2: Starting dashboard in background..."
rstat-dashboard &
DASHBOARD_PID=$!
sleep 10
# 3. Export the overall summary image.
echo "Step 3: Exporting overall summary image..."
# Overall daily image
python export_image.py --overall
# 4. Post the image to r/rstat.
echo "Step 4: Posting image to Reddit..."
python post_to_reddit.py --target-subreddit rstat
# Subreddit daily image
python export_image.py --subreddit wallstreetbets
# 5. Clean up by stopping the dashboard server.
echo "Step 5: Stopping dashboard server..."
kill $DASHBOARD_PID
echo "--- RSTAT Daily Job Complete ---"
# Weekly view
python export_image.py --subreddit wallstreetbets --weekly
```
**Before proceeding, you must edit the two absolute paths at the top of this script to match your system.**
**Step 2: Make the Script Executable**
Output files are saved into the `images/` folder, e.g. `overall_summary_daily_1700000000.png`.
Tip: If you want to export from a local dashboard instead of rstat.net, edit `base_url` in `export_image.py`.
## Post images to Reddit (post_to_reddit.py)
One-time OAuth2 step to obtain a refresh token:
1) In your Reddit app settings, set the redirect URI to exactly `http://localhost:5000` (matches the script).
2) Run:
```bash
python get_refresh_token.py
```
Follow the on-screen steps: open the generated URL, allow, copy the redirected URL, paste back. Add the printed token to `.env` as `REDDIT_REFRESH_TOKEN`.
Now you can post:
```bash
# Post the most recent overall image to r/rstat
python post_to_reddit.py
# Post the most recent daily image for a subreddit
python post_to_reddit.py --subreddit wallstreetbets
# Post weekly image for a subreddit
python post_to_reddit.py --subreddit wallstreetbets --weekly
# Choose a target subreddit and (optionally) a flair ID
python post_to_reddit.py --subreddit wallstreetbets --target-subreddit rstat --flair-id <ID>
```
Need a flair ID? Use the helper:
```bash
rstat-flairs wallstreetbets
```
## Cleanup utilities (rstat-cleanup)
Remove blacklisted “ticker” rows and/or purge data for subreddits no longer in your config.
```bash
# Show help
rstat-cleanup --help
# Remove tickers that are in the internal COMMON_WORDS_BLACKLIST
rstat-cleanup --tickers
# Remove any subreddit data not in subreddits.json
rstat-cleanup --subreddits
# Use a custom config file
rstat-cleanup --subreddits my_subs.json
# Run both tasks
rstat-cleanup --all
```
## Automation (cron)
An example `run_daily_job.sh` is provided. Update `BASE_DIR` and make it executable:
```bash
chmod +x run_daily_job.sh
```
**Step 3: Schedule the Cron Job**
Add a cron entry (example 22:00 daily):
1. Run `crontab -e` to open your crontab editor.
2. Add the following line to run the script every day at 10:00 PM and log its output:
```
0 22 * * * /absolute/path/to/reddit_stock_analyzer/run_daily_job.sh >> /absolute/path/to/reddit_stock_analyzer/cron.log 2>&1
```
```
0 22 * * * /path/to/your/project/reddit_stock_analyzer/run_daily_job.sh >> /path/to/your/project/reddit_stock_analyzer/cron.log 2>&1
```
## Docker
Your project is now fully and securely automated.
Builds a Tailwind CSS layer, then a Python runtime with gunicorn. The compose files include optional nginx and varnish.
Quick start for the dashboard only (uses your host `reddit_stocks.db`):
```bash
docker compose up -d rstat-dashboard
```
Notes:
- The `rstat-dashboard` container mounts `./reddit_stocks.db` read-only. Populate it by running `rstat` on the host (or add a separate CLI container).
- Prod compose includes nginx (and optional certbot/varnish) configs under `config/`.
## Data model (SQLite)
- `tickers(id, symbol UNIQUE, market_cap, closing_price, last_updated)`
- `subreddits(id, name UNIQUE)`
- `mentions(id, ticker_id, subreddit_id, post_id, comment_id NULLABLE, mention_type, mention_sentiment, mention_timestamp, UNIQUE(ticker_id, post_id, comment_id))`
- `posts(id, post_id UNIQUE, title, post_url, subreddit_id, post_timestamp, comment_count, avg_comment_sentiment)`
Uniqueness prevents duplicates across post/comment granularity. Cleanup helpers remove blacklisted “tickers” and stale subreddits.
## UI and Tailwind
The CSS (`static/css/style.css`) is generated from `static/css/input.css` using Tailwind 4 during Docker build. If you want to tweak UI locally:
```bash
npm install
npx tailwindcss -i ./static/css/input.css -o ./static/css/style.css --minify
```
## Troubleshooting
- Missing VADER: Run `python rstat_tool/setup_nltk.py` once (in your venv).
- Playwright errors: Run `playwright install` once; ensure lib dependencies are present on your OS.
- yfinance returns None: Retry later; some tickers or regions can be spotty. The app tolerates missing financials.
- Flair required: If posting fails with flair errors, fetch a valid flair ID and pass `--flair-id`.
- Empty dashboards: Make sure `rstat` ran recently and `.env` is set; check `rstat.log`.
- DB locked: If you edit while the dashboard is reading, wait or stop the server; SQLite locks are short-lived.
## Safety and notes
- Do not commit `.env` or your database if it contains sensitive data.
- This project is for research/entertainment. Not investment advice.
---
Made with Python, Flask, NLTK, Playwright, and Tailwind.

View File

@@ -4,6 +4,7 @@ import argparse
import os
import time
from playwright.sync_api import sync_playwright
from pathlib import Path
# Define the output directory as a constant
OUTPUT_DIR = "images"
@@ -12,17 +13,17 @@ OUTPUT_DIR = "images"
def export_image(url_path, filename_prefix):
"""
Launches a headless browser, navigates to a URL path, and screenshots
the .image-container element, saving it to the OUTPUT_DIR.
the main content element, saving it to the OUTPUT_DIR.
"""
print(f"-> Preparing to export image for: {filename_prefix}")
# 1. Ensure the output directory exists
os.makedirs(OUTPUT_DIR, exist_ok=True)
base_url = "http://localhost:5000"
base_url = "https://rstat.net"
# Ensure the URL path starts correctly
url_path = url_path.lstrip("/")
url = f"{base_url}/{url_path}"
# 2. Construct the full output path including the new directory
output_file = os.path.join(OUTPUT_DIR, f"{filename_prefix}_{int(time.time())}.png")
with sync_playwright() as p:
@@ -33,10 +34,15 @@ def export_image(url_path, filename_prefix):
page.set_viewport_size({"width": 1920, "height": 1080})
print(f" Navigating to {url}...")
page.goto(url, wait_until="networkidle") # Wait for network to be idle
# Use 'domcontentloaded' for faster navigation when possible
page.goto(url, wait_until="domcontentloaded")
# Target the specific element we want to screenshot
element = page.locator(".image-container")
# Give fonts and styles a moment to render after the DOM is ready
page.wait_for_timeout(500)
# --- THIS IS THE CORRECTED LINE ---
# Target the new, correct class for our main content card
element = page.locator(".max-w-3xl")
print(f" Saving screenshot to {output_file}...")
element.screenshot(path=output_file)
@@ -52,7 +58,6 @@ def export_image(url_path, filename_prefix):
if __name__ == "__main__":
# Use a mutually exclusive group to ensure only one mode is chosen
parser = argparse.ArgumentParser(description="Export subreddit sentiment images.")
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("-s", "--subreddit", help="The name of the subreddit to export.")
@@ -64,20 +69,18 @@ if __name__ == "__main__":
"-w",
"--weekly",
action="store_true",
help="Export the weekly view instead of the daily view (only for --subreddit).",
help="Export the weekly view instead of the daily view.",
)
args = parser.parse_args()
# Determine the correct URL path and filename based on arguments
view_type = "weekly" if args.weekly else "daily"
if args.subreddit:
view_type = "weekly" if args.weekly else "daily"
# Add ?view=... and the new &image=true parameter
url_path_to_render = f"subreddit/{args.subreddit}?view={view_type}&image=true"
filename_prefix_to_save = f"{args.subreddit}_{view_type}"
export_image(url_path_to_render, filename_prefix_to_save)
elif args.overall:
# For overall, we assume daily view for the image
url_path_to_render = "/?view=daily&image=true"
filename_prefix_to_save = "overall_summary_daily"
url_path_to_render = f"/?view={view_type}&image=true"
filename_prefix_to_save = f"overall_summary_{view_type}"
export_image(url_path_to_render, filename_prefix_to_save)

View File

@@ -8,7 +8,6 @@ import praw
from dotenv import load_dotenv
from pathlib import Path
# --- CONFIGURATION ---
IMAGE_DIR = "images"
@@ -51,39 +50,33 @@ def find_latest_image(pattern):
print(f"Error finding image file: {e}")
return None
def get_flair_id(subreddit, flair_text):
"""
Attempts to find the ID of a flair by its text.
Returns the ID string or None if not found or an error occurs.
"""
if not flair_text:
return None
print(f"Attempting to find Flair ID for text: '{flair_text}'...")
try:
flairs = subreddit.flair.link_templates
for flair in flairs:
if flair['text'].lower() == flair_text.lower():
print(f" -> Found Flair ID: {flair['id']}")
return flair['id']
print(" -> Warning: No matching flair text found.")
return None
except Exception as e:
print(f" -> Warning: Could not fetch flairs for this subreddit (Error: {e}). Proceeding without flair.")
return None
def main():
"""Main function to find an image and post it to Reddit."""
parser = argparse.ArgumentParser(
description="Find the latest sentiment image and post it to a subreddit."
)
parser.add_argument("-s", "--subreddit", help="The source subreddit of the image to post. (Defaults to overall summary)")
parser.add_argument("-w", "--weekly", action="store_true", help="Post the weekly summary instead of the daily one.")
parser.add_argument("-t", "--target-subreddit", default="rstat", help="The subreddit to post the image to. (Default: rstat)")
parser.add_argument("--flair-text", help="The text of the flair to search for (e.g., 'Daily Summary').")
parser.add_argument("--flair-id", help="Manually provide a specific Flair ID (overrides --flair-text).")
parser.add_argument(
"-s",
"--subreddit",
help="The source subreddit of the image to post. (Defaults to overall summary)",
)
parser.add_argument(
"-w",
"--weekly",
action="store_true",
help="Post the weekly summary instead of the daily one.",
)
parser.add_argument(
"-t",
"--target-subreddit",
default="rstat",
help="The subreddit to post the image to. (Default: rstat)",
)
parser.add_argument(
"--flair-id",
help="The specific Flair ID to use for the post (required for some subreddits).",
)
args = parser.parse_args()
@@ -122,35 +115,31 @@ def main():
reddit = get_reddit_instance()
if not reddit:
return
try:
target_sub = reddit.subreddit(args.target_subreddit)
# --- NEW SMART FLAIR LOGIC ---
final_flair_id = None
if args.flair_id:
# If the user provides a specific ID, use it directly.
print(f"Using provided Flair ID: {args.flair_id}")
final_flair_id = args.flair_id
elif args.flair_text:
# If they provide text, try to find the ID automatically.
final_flair_id = get_flair_id(target_sub, args.flair_text)
print(f"Submitting '{post_title}' to r/{target_sub.display_name}...")
# --- Simplified submission logic ---
submission = target_sub.submit_image(
title=post_title,
image_path=image_to_post,
flair_id=final_flair_id # This will be the found ID or None
flair_id=args.flair_id, # Directly use the provided ID. This will be None if not provided.
)
print("\n--- Post Successful! ---")
print(f"Post URL: {submission.shortlink}")
except Exception as e:
print(f"\nAn error occurred while posting to Reddit: {e}")
if 'FLAIR_REQUIRED' in str(e):
print("\nHint: This subreddit requires a flair. Try finding the flair text or ID and use the --flair-text or --flair-id argument.")
if "FLAIR_REQUIRED" in str(e).upper():
print(
"\nHINT: This subreddit requires a flair. You MUST provide a valid Flair ID using the --flair-id argument."
)
print(
"Please follow the manual steps to find the Flair ID using your browser's developer tools."
)
if __name__ == "__main__":
main()

View File

@@ -8,8 +8,8 @@ from .database import (
get_deep_dive_details,
get_daily_summary_for_subreddit,
get_weekly_summary_for_subreddit,
get_overall_daily_summary, # Now correctly imported
get_overall_weekly_summary, # Now correctly imported
get_overall_daily_summary,
get_overall_weekly_summary,
)
app = Flask(__name__, template_folder='../templates', static_folder='../static')
@@ -41,14 +41,20 @@ def overall_dashboard():
view_type = request.args.get("view", "daily")
is_image_mode = request.args.get("image") == "true"
try:
# Get the 'top' parameter, default to 10, and ensure it's an integer
top_n = int(request.args.get('top', 10))
except (ValueError, TypeError):
top_n = 10 # Fallback to 10 if the value is invalid
if view_type == "weekly":
tickers, start, end = get_overall_weekly_summary()
tickers, start, end = get_overall_weekly_summary(limit=top_n)
date_string = f"{start.strftime('%b %d')} - {end.strftime('%b %d, %Y')}"
subtitle = "All Subreddits - Top 10 Weekly"
subtitle = f"All Subreddits - Top {top_n} Weekly"
else: # Default to daily
tickers = get_overall_daily_summary()
tickers = get_overall_daily_summary(limit=top_n)
date_string = datetime.now(timezone.utc).strftime("%Y-%m-%d")
subtitle = "All Subreddits - Top 10 Daily"
subtitle = f"All Subreddits - Top {top_n} Daily"
return render_template(
"dashboard_view.html",
@@ -69,16 +75,21 @@ def subreddit_dashboard(name):
view_type = request.args.get("view", "daily")
is_image_mode = request.args.get("image") == "true"
try:
top_n = int(request.args.get('top', 10))
except (ValueError, TypeError):
top_n = 10
if view_type == "weekly":
today = datetime.now(timezone.utc)
target_date = today - timedelta(days=7)
tickers, start, end = get_weekly_summary_for_subreddit(name, target_date)
tickers, start, end = get_weekly_summary_for_subreddit(name, target_date, limit=top_n)
date_string = f"{start.strftime('%b %d')} - {end.strftime('%b %d, %Y')}"
subtitle = f"r/{name} - Top 10 Weekly"
subtitle = f"r/{name} - Top {top_n} Weekly"
else: # Default to daily
tickers = get_daily_summary_for_subreddit(name)
tickers = get_daily_summary_for_subreddit(name, limit=top_n)
date_string = datetime.now(timezone.utc).strftime("%Y-%m-%d")
subtitle = f"r/{name} - Top 10 Daily"
subtitle = f"r/{name} - Top {top_n} Daily"
return render_template(
"dashboard_view.html",

View File

@@ -2,7 +2,11 @@
import sqlite3
import time
from .ticker_extractor import COMMON_WORDS_BLACKLIST
from .ticker_extractor import (
COMMON_WORDS_BLACKLIST,
extract_golden_tickers,
extract_potential_tickers,
)
from .logger_setup import logger as log
from datetime import datetime, timedelta, timezone
@@ -111,12 +115,14 @@ def initialize_db():
ticker_id INTEGER,
subreddit_id INTEGER,
post_id TEXT NOT NULL,
comment_id TEXT, -- NEW: Will be NULL for post mentions
mention_type TEXT NOT NULL,
mention_sentiment REAL,
post_avg_sentiment REAL,
mention_timestamp INTEGER NOT NULL,
FOREIGN KEY (ticker_id) REFERENCES tickers (id),
FOREIGN KEY (subreddit_id) REFERENCES subreddits (id)
FOREIGN KEY (subreddit_id) REFERENCES subreddits (id),
-- The new, perfect uniqueness rule:
UNIQUE(ticker_id, post_id, comment_id)
)
"""
)
@@ -148,27 +154,27 @@ def add_mention(
mention_type,
timestamp,
mention_sentiment,
post_avg_sentiment=None,
comment_id=None,
):
cursor = conn.cursor()
try:
cursor.execute(
"""
INSERT INTO mentions (ticker_id, subreddit_id, post_id, mention_type, mention_timestamp, mention_sentiment, post_avg_sentiment)
INSERT INTO mentions (ticker_id, subreddit_id, post_id, comment_id, mention_type, mention_timestamp, mention_sentiment)
VALUES (?, ?, ?, ?, ?, ?, ?)
""",
(
ticker_id,
subreddit_id,
post_id,
comment_id,
mention_type,
timestamp,
mention_sentiment,
post_avg_sentiment,
),
)
conn.commit()
except sqlite3.IntegrityError:
# This will now correctly catch and ignore any true duplicates.
pass
@@ -203,23 +209,6 @@ def get_ticker_info(conn, ticker_id):
return cursor.fetchone()
def get_week_start_end(for_date):
"""
Calculates the start (Monday, 00:00:00) and end (Sunday, 23:59:59)
of the week that a given date falls into.
Returns two datetime objects.
"""
# Monday is 0, Sunday is 6
start_of_week = for_date - timedelta(days=for_date.weekday())
end_of_week = start_of_week + timedelta(days=6)
# Set time to the very beginning and very end of the day for an inclusive range
start_of_week = start_of_week.replace(hour=0, minute=0, second=0, microsecond=0)
end_of_week = end_of_week.replace(hour=23, minute=59, second=59, microsecond=999999)
return start_of_week, end_of_week
def add_or_update_post_analysis(conn, post_data):
"""
Inserts a new post analysis record or updates an existing one.
@@ -240,127 +229,17 @@ def add_or_update_post_analysis(conn, post_data):
conn.commit()
def get_overall_summary(limit=10):
"""
Gets the top tickers across all subreddits from the LAST 24 HOURS.
"""
conn = get_db_connection()
one_day_ago = datetime.now(timezone.utc) - timedelta(days=1)
one_day_ago_timestamp = int(one_day_ago.timestamp())
query = """
SELECT t.symbol, t.market_cap, t.closing_price, COUNT(m.id) as mention_count,
SUM(CASE WHEN m.mention_sentiment > 0.1 THEN 1 ELSE 0 END) as bullish_mentions,
SUM(CASE WHEN m.mention_sentiment < -0.1 THEN 1 ELSE 0 END) as bearish_mentions,
SUM(CASE WHEN m.mention_sentiment BETWEEN -0.1 AND 0.1 THEN 1 ELSE 0 END) as neutral_mentions
FROM mentions m JOIN tickers t ON m.ticker_id = t.id
WHERE m.mention_timestamp >= ? -- <-- ADDED TIME FILTER
GROUP BY t.symbol, t.market_cap, t.closing_price
ORDER BY mention_count DESC LIMIT ?;
"""
results = conn.execute(query, (one_day_ago_timestamp, limit)).fetchall()
conn.close()
return results
def get_week_start_end(for_date):
"""Calculates the start (Monday) and end (Sunday) of the week."""
start_of_week = for_date - timedelta(days=for_date.weekday())
end_of_week = start_of_week + timedelta(days=6)
start_of_week = start_of_week.replace(hour=0, minute=0, second=0, microsecond=0)
end_of_week = end_of_week.replace(hour=23, minute=59, second=59, microsecond=999999)
return start_of_week, end_of_week
def get_subreddit_summary(subreddit_name, limit=10):
"""
Gets the top tickers for a specific subreddit from the LAST 24 HOURS.
"""
conn = get_db_connection()
one_day_ago = datetime.now(timezone.utc) - timedelta(days=1)
one_day_ago_timestamp = int(one_day_ago.timestamp())
query = """
SELECT t.symbol, t.market_cap, t.closing_price, COUNT(m.id) as mention_count,
SUM(CASE WHEN m.mention_sentiment > 0.1 THEN 1 ELSE 0 END) as bullish_mentions,
SUM(CASE WHEN m.mention_sentiment < -0.1 THEN 1 ELSE 0 END) as bearish_mentions,
SUM(CASE WHEN m.mention_sentiment BETWEEN -0.1 AND 0.1 THEN 1 ELSE 0 END) as neutral_mentions
FROM mentions m JOIN tickers t ON m.ticker_id = t.id JOIN subreddits s ON m.subreddit_id = s.id
WHERE LOWER(s.name) = LOWER(?) AND m.mention_timestamp >= ? -- <-- ADDED TIME FILTER
GROUP BY t.symbol, t.market_cap, t.closing_price
ORDER BY mention_count DESC LIMIT ?;
"""
results = conn.execute(
query, (subreddit_name, one_day_ago_timestamp, limit)
).fetchall()
conn.close()
return results
def get_daily_summary_for_subreddit(subreddit_name):
"""Gets a summary for the DAILY image view (last 24 hours)."""
conn = get_db_connection()
one_day_ago = datetime.now(timezone.utc) - timedelta(days=1)
one_day_ago_timestamp = int(one_day_ago.timestamp())
query = """
SELECT
t.symbol, t.market_cap, t.closing_price,
COUNT(m.id) as total_mentions,
COUNT(CASE WHEN m.mention_sentiment > 0.1 THEN 1 END) as bullish_mentions,
COUNT(CASE WHEN m.mention_sentiment < -0.1 THEN 1 END) as bearish_mentions
FROM mentions m JOIN tickers t ON m.ticker_id = t.id JOIN subreddits s ON m.subreddit_id = s.id
WHERE LOWER(s.name) = LOWER(?) AND m.mention_timestamp >= ?
GROUP BY t.symbol, t.market_cap, t.closing_price
ORDER BY total_mentions DESC LIMIT 10;
"""
results = conn.execute(query, (subreddit_name, one_day_ago_timestamp)).fetchall()
conn.close()
return results
def get_weekly_summary_for_subreddit(subreddit_name, for_date):
"""Gets a summary for the WEEKLY image view (full week)."""
conn = get_db_connection()
start_of_week, end_of_week = get_week_start_end(for_date)
start_timestamp = int(start_of_week.timestamp())
end_timestamp = int(end_of_week.timestamp())
query = """
SELECT
t.symbol, t.market_cap, t.closing_price,
COUNT(m.id) as total_mentions,
COUNT(CASE WHEN m.mention_sentiment > 0.1 THEN 1 END) as bullish_mentions,
COUNT(CASE WHEN m.mention_sentiment < -0.1 THEN 1 END) as bearish_mentions
FROM mentions m JOIN tickers t ON m.ticker_id = t.id JOIN subreddits s ON m.subreddit_id = s.id
WHERE LOWER(s.name) = LOWER(?) AND m.mention_timestamp BETWEEN ? AND ?
GROUP BY t.symbol, t.market_cap, t.closing_price
ORDER BY total_mentions DESC LIMIT 10;
"""
results = conn.execute(
query, (subreddit_name, start_timestamp, end_timestamp)
).fetchall()
conn.close()
return results, start_of_week, end_of_week
def get_overall_image_view_summary():
"""
Gets a summary of top tickers across ALL subreddits for the DAILY image view (last 24 hours).
"""
conn = get_db_connection()
one_day_ago = datetime.now(timezone.utc) - timedelta(days=1)
one_day_ago_timestamp = int(one_day_ago.timestamp())
query = """
SELECT
t.symbol, t.market_cap, t.closing_price,
COUNT(m.id) as total_mentions,
COUNT(CASE WHEN m.mention_sentiment > 0.1 THEN 1 END) as bullish_mentions,
COUNT(CASE WHEN m.mention_sentiment < -0.1 THEN 1 END) as bearish_mentions
FROM mentions m JOIN tickers t ON m.ticker_id = t.id
WHERE m.mention_timestamp >= ? -- <-- ADDED TIME FILTER
GROUP BY t.symbol, t.market_cap, t.closing_price
ORDER BY total_mentions DESC LIMIT 10;
"""
results = conn.execute(query, (one_day_ago_timestamp,)).fetchall()
conn.close()
return results
def get_overall_daily_summary():
"""
Gets the top tickers across all subreddits from the LAST 24 HOURS.
(This is a copy of get_overall_summary, renamed for clarity).
"""
def get_overall_daily_summary(limit=10):
"""Gets the top tickers across all subreddits from the LAST 24 HOURS."""
conn = get_db_connection()
one_day_ago = datetime.now(timezone.utc) - timedelta(days=1)
one_day_ago_timestamp = int(one_day_ago.timestamp())
@@ -371,22 +250,19 @@ def get_overall_daily_summary():
FROM mentions m JOIN tickers t ON m.ticker_id = t.id
WHERE m.mention_timestamp >= ?
GROUP BY t.symbol, t.market_cap, t.closing_price
ORDER BY total_mentions DESC LIMIT 10;
ORDER BY total_mentions DESC LIMIT ?;
"""
results = conn.execute(query, (one_day_ago_timestamp,)).fetchall()
results = conn.execute(query, (one_day_ago_timestamp, limit)).fetchall()
conn.close()
return results
def get_overall_weekly_summary():
"""
Gets the top tickers across all subreddits for the LAST 7 DAYS.
"""
def get_overall_weekly_summary(limit=10):
"""Gets the top tickers across all subreddits for LAST WEEK (Mon-Sun)."""
conn = get_db_connection()
today = datetime.now(timezone.utc)
start_of_week, end_of_week = get_week_start_end(
today - timedelta(days=7)
) # Get last week's boundaries
target_date_for_last_week = today - timedelta(days=7)
start_of_week, end_of_week = get_week_start_end(target_date_for_last_week)
start_timestamp = int(start_of_week.timestamp())
end_timestamp = int(end_of_week.timestamp())
query = """
@@ -396,9 +272,50 @@ def get_overall_weekly_summary():
FROM mentions m JOIN tickers t ON m.ticker_id = t.id
WHERE m.mention_timestamp BETWEEN ? AND ?
GROUP BY t.symbol, t.market_cap, t.closing_price
ORDER BY total_mentions DESC LIMIT 10;
ORDER BY total_mentions DESC LIMIT ?;
"""
results = conn.execute(query, (start_timestamp, end_timestamp)).fetchall()
results = conn.execute(query, (start_timestamp, end_timestamp, limit)).fetchall()
conn.close()
return results, start_of_week, end_of_week
def get_daily_summary_for_subreddit(subreddit_name, limit=10):
"""Gets a summary for a subreddit's DAILY view (last 24 hours)."""
conn = get_db_connection()
one_day_ago = datetime.now(timezone.utc) - timedelta(days=1)
one_day_ago_timestamp = int(one_day_ago.timestamp())
query = """
SELECT t.symbol, t.market_cap, t.closing_price, COUNT(m.id) as total_mentions,
SUM(CASE WHEN m.mention_sentiment > 0.1 THEN 1 ELSE 0 END) as bullish_mentions,
SUM(CASE WHEN m.mention_sentiment < -0.1 THEN 1 ELSE 0 END) as bearish_mentions
FROM mentions m JOIN tickers t ON m.ticker_id = t.id JOIN subreddits s ON m.subreddit_id = s.id
WHERE LOWER(s.name) = LOWER(?) AND m.mention_timestamp >= ?
GROUP BY t.symbol, t.market_cap, t.closing_price
ORDER BY total_mentions DESC LIMIT ?;
"""
results = conn.execute(query, (subreddit_name, one_day_ago_timestamp, limit)).fetchall()
conn.close()
return results
def get_weekly_summary_for_subreddit(subreddit_name, for_date, limit=10):
"""Gets a summary for a subreddit's WEEKLY view (for a specific week)."""
conn = get_db_connection()
start_of_week, end_of_week = get_week_start_end(for_date)
start_timestamp = int(start_of_week.timestamp())
end_timestamp = int(end_of_week.timestamp())
query = """
SELECT t.symbol, t.market_cap, t.closing_price, COUNT(m.id) as total_mentions,
SUM(CASE WHEN m.mention_sentiment > 0.1 THEN 1 ELSE 0 END) as bullish_mentions,
SUM(CASE WHEN m.mention_sentiment < -0.1 THEN 1 ELSE 0 END) as bearish_mentions
FROM mentions m JOIN tickers t ON m.ticker_id = t.id JOIN subreddits s ON m.subreddit_id = s.id
WHERE LOWER(s.name) = LOWER(?) AND m.mention_timestamp BETWEEN ? AND ?
GROUP BY t.symbol, t.market_cap, t.closing_price
ORDER BY total_mentions DESC LIMIT ?;
"""
results = conn.execute(
query, (subreddit_name, start_timestamp, end_timestamp, limit)
).fetchall()
conn.close()
return results, start_of_week, end_of_week

View File

@@ -0,0 +1,76 @@
# rstat_tool/flair_finder.py
# A dedicated tool to find available link flairs for a subreddit.
import argparse
import sys
import os
import praw
from dotenv import load_dotenv
from pathlib import Path
def get_reddit_instance_for_flairs():
"""
Initializes and returns an authenticated PRAW instance using the refresh token.
This is a copy of the robust authentication from the posting script.
"""
# Find the .env file relative to the project root
env_path = Path(__file__).parent.parent / '.env'
load_dotenv(dotenv_path=env_path)
client_id = os.getenv("REDDIT_CLIENT_ID")
client_secret = os.getenv("REDDIT_CLIENT_SECRET")
user_agent = os.getenv("REDDIT_USER_AGENT")
refresh_token = os.getenv("REDDIT_REFRESH_TOKEN")
if not all([client_id, client_secret, user_agent, refresh_token]):
print("Error: Reddit API credentials (including REDDIT_REFRESH_TOKEN) must be set in .env file.", file=sys.stderr)
return None
return praw.Reddit(
client_id=client_id,
client_secret=client_secret,
user_agent=user_agent,
refresh_token=refresh_token
)
def main():
"""Main function to fetch and display flairs."""
parser = argparse.ArgumentParser(description="Fetch and display available post flairs for a subreddit.")
parser.add_argument("subreddit", help="The name of the subreddit to check.")
args = parser.parse_args()
reddit = get_reddit_instance_for_flairs()
if not reddit:
sys.exit(1)
print(f"\n--- Attempting to Fetch Post Flairs for r/{args.subreddit} ---")
try:
# This uses PRAW's generic GET request method to hit the specific API endpoint.
api_path = f"/r/{args.subreddit}/api/link_flair_v2.json"
flairs = reddit.get(api_path, params={"raw_json": 1})
if not flairs:
print("No flairs found or flair list is empty for this subreddit.")
return
print("\n--- Available Post Flairs ---")
found_count = 0
for flair in flairs:
flair_text = flair.get('text')
flair_id = flair.get('id')
if flair_text and flair_id:
print(f" Flair Text: '{flair_text}'")
print(f" Flair ID: {flair_id}\n")
found_count += 1
if found_count == 0:
print("No flairs with both text and ID were found.")
except Exception as e:
print(f"\nAn error occurred: {e}", file=sys.stderr)
print("Hint: Please ensure the subreddit exists and that your authenticated user has permission to view it.", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()

View File

@@ -3,116 +3,118 @@
COMMON_WORDS_BLACKLIST = {
"401K", "403B", "457B", "AAVE", "ABC", "ABOUT", "ABOVE", "ACAT", "ADAM", "ADHD",
"ADR", "ADS", "ADX", "AEDT", "AEST", "AF", "AFAIK", "AFTER", "AGENT", "AH",
"AI", "AINT", "AK", "ALD", "ALGOS", "ALIVE", "ALL", "ALPHA", "ALSO", "AM",
"AMA", "AMEX", "AMK", "AMY", "AND", "ANSS", "ANY", "APES", "APL", "APPL",
"APPLE", "APR", "APUS", "APY", "AR", "ARBK", "ARE", "AREA", "ARH", "ARK",
"AROUND", "ART", "AS", "ASAP", "ASEAN", "ASK", "ASS", "ASSET", "AST", "AT",
"ATH", "ATL", "ATM", "AUD", "AUG", "AUM", "AV", "AVG", "AWS", "BABY",
"BAG", "BAGS", "BALLS", "BAN", "BANG", "BASIC", "BBB", "BBBY", "BE", "BEAR",
"BEARS", "BECN", "BEER", "BELL", "BELOW", "BETA", "BETS", "BF", "BID", "BIG",
"BIS", "BITCH", "BKEY", "BLEND", "BMW", "BNP", "BNPL", "BOE", "BOJ", "BOLL",
"BOMB", "BOND", "BONED", "BORN", "BOTH", "BOTS", "BOY", "BOYS", "BRB", "BRICS",
"BRK", "BRKA", "BRKB", "BRL", "BROKE", "BRRRR", "BS", "BSE", "BST", "BSU",
"BT", "BTC", "BTS", "BTW", "BUDDY", "BULL", "BULLS", "BUST", "BUT", "BUY",
"BUZZ", "CAD", "CAFE", "CAGR", "CALL", "CALLS", "CAN", "CAP", "CARB", "CARES",
"CASE", "CATL", "CBD", "CBGM", "CBS", "CCI", "CCP", "CD", "CDN", "CEO",
"CEST", "CET", "CEX", "CFD", "CFO", "CFPB", "CHART", "CHASE", "CHATS", "CHECK",
"CHF", "CHICK", "CHIP", "CHIPS", "CIA", "CIC", "CLAIM", "CLEAN", "CLICK", "CLOSE",
"CMON", "CN", "CNBC", "CNN", "CNY", "COBRA", "COCK", "COGS", "COIL", "COKE",
"COME", "COST", "COULD", "COVID", "CPAP", "CPI", "CRA", "CRE", "CRO", "CRV",
"CSE", "CSP", "CSS", "CST", "CTB", "CTEP", "CTO", "CUCKS", "CULT", "CUM",
"CUSMA", "CUTS", "CUV", "CYCLE", "CZK", "DA", "DAILY", "DAO", "DATE", "DAX",
"DAY", "DAYS", "DCA", "DCF", "DD", "DEAL", "DEBT", "DEEZ", "DEMO", "DET",
"DEX", "DGAF", "DIA", "DID", "DIDNT", "DIP", "DITM", "DIV", "DIY", "DJI",
"DJIA", "DJTJ", "DKK", "DL", "DM", "DMV", "DNI", "DNUTZ", "DO", "DOD",
"DOE", "DOES", "DOGE", "DOING", "DOJ", "DOM", "DONNY", "DONT", "DONUT", "DOOR",
"DOWN", "DOZEN", "DPI", "DR", "DUDE", "DUMP", "DUNT", "DUT", "DUTY", "DXY",
"DXYXBT", "DYI", "DYNK", "DYODD", "DYOR", "EACH", "EARLY", "EARN", "EAST", "EASY",
"ECB", "EDGAR", "EDIT", "EDT", "EJ", "EMA", "EMJ", "EMT", "END", "ENRON",
"ENSI", "ENV", "EO", "EOD", "EOM", "EOW", "EOY", "EPA", "EPK", "EPS",
"ER", "ESG", "ESPP", "EST", "ETA", "ETF", "ETFS", "ETH", "ETL", "EU",
"EUR", "EV", "EVEN", "EVERY", "EVTOL", "EXTRA", "EYES", "EZ", "FAANG", "FAFO",
"FAQ", "FAR", "FAST", "FBI", "FCC", "FCFF", "FD", "FDA", "FEE", "FFH",
"FFS", "FGMA", "FIG", "FIGMA", "FIHTX", "FILES", "FINAL", "FIND", "FING", "FINRA",
"FINT", "FINTX", "FINTY", "FIRE", "FIRST", "FKIN", "FLRAA", "FLT", "FLY", "FML",
"AI", "AINT", "AK", "AKSJE", "ALD", "ALGOS", "ALIVE", "ALL", "ALPHA", "ALSO",
"AM", "AMA", "AMEX", "AMK", "AMY", "AND", "ANSS", "ANY", "APES", "APL",
"APPL", "APPLE", "APR", "APUS", "APY", "AR", "ARBK", "ARE", "AREA", "ARH",
"ARK", "AROUND", "ART", "AS", "ASAP", "ASEAN", "ASK", "ASS", "ASSET", "AST",
"AT", "ATH", "ATL", "ATM", "AUD", "AUG", "AUM", "AV", "AVG", "AWS",
"BABY", "BAD", "BAG", "BAGS", "BALLS", "BAN", "BANG", "BASIC", "BBB", "BBBY",
"BE", "BEAR", "BEARS", "BECN", "BEER", "BELL", "BELOW", "BETA", "BETS", "BF",
"BID", "BIG", "BIS", "BITCH", "BKEY", "BLEND", "BLOW", "BMW", "BNP", "BNPL",
"BOARD", "BOE", "BOJ", "BOLL", "BOMB", "BOND", "BONED", "BORN", "BOTH", "BOTS",
"BOY", "BOYS", "BRB", "BRICS", "BRK", "BRKA", "BRKB", "BRL", "BROKE", "BRRRR",
"BS", "BSE", "BST", "BSU", "BT", "BTC", "BTS", "BTW", "BUDDY", "BULL",
"BULLS", "BUST", "BUT", "BUY", "BUZZ", "CAD", "CAFE", "CAGR", "CALL", "CALLS",
"CAN", "CAP", "CARB", "CARES", "CASE", "CATL", "CBD", "CBGM", "CBS", "CCI",
"CCP", "CD", "CDN", "CEO", "CEST", "CET", "CEX", "CFD", "CFO", "CFPB",
"CHART", "CHASE", "CHATS", "CHECK", "CHF", "CHICK", "CHIP", "CHIPS", "CIA", "CIC",
"CLAIM", "CLEAN", "CLICK", "CLOSE", "CMON", "CN", "CNBC", "CNN", "CNY", "COBRA",
"COCK", "COGS", "COIL", "COKE", "COME", "COST", "COULD", "COVID", "CPAP", "CPI",
"CRA", "CRE", "CRO", "CRV", "CSE", "CSP", "CSS", "CST", "CTB", "CTEP",
"CTO", "CUCKS", "CULT", "CUM", "CUSMA", "CUTS", "CUV", "CYCLE", "CZK", "DA",
"DAILY", "DAO", "DART", "DATA", "DATE", "DAX", "DAY", "DAYS", "DCA", "DCF",
"DD", "DEAL", "DEBT", "DEEZ", "DEMO", "DET", "DEX", "DGAF", "DIA", "DID",
"DIDNT", "DIP", "DITM", "DIV", "DIY", "DJI", "DJIA", "DJTJ", "DKK", "DL",
"DM", "DMV", "DNI", "DNUTZ", "DO", "DOD", "DOE", "DOES", "DOGE", "DOING",
"DOJ", "DOM", "DONNY", "DONT", "DONUT", "DOOR", "DOWN", "DOZEN", "DPI", "DR",
"DUDE", "DUMP", "DUNT", "DUT", "DUTY", "DXY", "DXYXBT", "DYI", "DYNK", "DYODD",
"DYOR", "EACH", "EARLY", "EARN", "EAST", "EASY", "EBIT", "ECB", "EDGAR", "EDIT",
"EDT", "EJ", "EMA", "EMJ", "EMT", "END", "ENRON", "ENSI", "ENV", "EO",
"EOD", "EOM", "EOW", "EOY", "EPA", "EPK", "EPS", "ER", "ESG", "ESPP",
"EST", "ETA", "ETF", "ETFS", "ETH", "ETHT", "ETL", "EU", "EUR", "EV",
"EVEN", "EVERY", "EVTOL", "EXTRA", "EYES", "EZ", "FAANG", "FAFO", "FAQ", "FAR",
"FAST", "FBI", "FCC", "FCFF", "FD", "FDA", "FED", "FEE", "FFH", "FFS",
"FGMA", "FIG", "FIGMA", "FIHTX", "FILES", "FINAL", "FIND", "FING", "FINRA", "FINT",
"FINTX", "FINTY", "FIRE", "FIRST", "FKIN", "FLOAT", "FLRAA", "FLT", "FLY", "FML",
"FOLO", "FOMC", "FOMO", "FOR", "FOREX", "FRAUD", "FREAK", "FRED", "FRG", "FROM",
"FRP", "FRS", "FSBO", "FSD", "FSE", "FSELK", "FSPSX", "FTD", "FTSE", "FUCK",
"FUCKS", "FUD", "FULL", "FUND", "FUNNY", "FVG", "FWIW", "FX", "FXAIX", "FXIAX",
"FXROX", "FY", "FYI", "FZROX", "GAAP", "GAIN", "GAVE", "GBP", "GC", "GDP",
"GET", "GFC", "GG", "GGTM", "GIVES", "GJ", "GL", "GLHF", "GMAT", "GMI",
"GMT", "GO", "GOAL", "GOAT", "GOD", "GOING", "GOLD", "GONE", "GONNA", "GOODS",
"GOPRO", "GPT", "GPU", "GRAB", "GREAT", "GREEN", "GSOV", "GST", "GTA", "GTC",
"GTFO", "GTG", "GUH", "GUNS", "GUY", "GUYS", "HAD", "HAHA", "HALF", "HAM",
"HANDS", "HAS", "HATE", "HAVE", "HBAR", "HCOL", "HEAR", "HEDGE", "HEGE", "HELD",
"HELL", "HELP", "HERE", "HEY", "HFCS", "HFT", "HGTV", "HIGH", "HIGHS", "HINT",
"HIS", "HITID", "HK", "HKD", "HKEX", "HODL", "HODOR", "HOF", "HOLD", "HOLY",
"HOME", "HOT", "HOUR", "HOURS", "HOW", "HS", "HSA", "HSI", "HT", "HTCI",
"HTF", "HTML", "HUF", "HUGE", "HV", "HYPE", "IANAL", "IATF", "IB", "IBS",
"ICSID", "ICT", "ID", "IDF", "IDK", "IF", "II", "IIRC", "IKKE", "IKZ",
"IM", "IMHO", "IMI", "IMO", "IN", "INC", "INR", "INTEL", "INTO", "IP",
"IPO", "IQVIA", "IRA", "IRAS", "IRC", "IRISH", "IRMAA", "IRS", "IS", "ISA",
"ISIN", "ISM", "ISN", "IST", "IT", "ITC", "ITM", "ITS", "ITWN", "IUIT",
"IV", "IVV", "IWM", "IXL", "IXLH", "IYKYK", "JAVA", "JD", "JDG", "JDM",
"JE", "JFC", "JK", "JLR", "JMO", "JOBS", "JOIN", "JOKE", "JP", "JPOW",
"JPY", "JS", "JST", "JUN", "JUST", "KARMA", "KEEP", "KILL", "KING", "KK",
"KLA", "KLP", "KNEW", "KNOW", "KO", "KOHLS", "KPMG", "KRW", "LA", "LANGT",
"LARGE", "LAST", "LATE", "LATER", "LBO", "LBTC", "LCS", "LDL", "LEADS", "LEAP",
"LEAPS", "LEARN", "LEI", "LET", "LETF", "LETS", "LFA", "LFG", "LFP", "LG",
"LGEN", "LIFE", "LIG", "LIGMA", "LIKE", "LIMIT", "LIST", "LLC", "LLM", "LM",
"LMAO", "LMAOO", "LMM", "LMN", "LOANS", "LOKO", "LOL", "LOLOL", "LONG", "LONGS",
"LOOK", "LOSE", "LOSS", "LOST", "LOVE", "LOVES", "LOW", "LOWER", "LOWS", "LP",
"LSS", "LTCG", "LUCID", "LUPD", "LYC", "LYING", "M&A", "MA", "MACD", "MAIL",
"MAKE", "MAKES", "MANGE", "MANY", "MASON", "MAX", "MAY", "MAYBE", "MBA", "MC",
"MCAP", "MCNA", "MCP", "ME", "MEAN", "MEME", "MERGE", "MERK", "MES", "MEXC",
"MF", "MFER", "MID", "MIGHT", "MIN", "MIND", "MINS", "ML", "MLB", "MLS",
"MM", "MMF", "MNQ", "MOASS", "MODEL", "MODTX", "MOM", "MONEY", "MONTH", "MONY",
"MOON", "MORE", "MOST", "MOU", "MSK", "MTVGA", "MUCH", "MUSIC", "MUST", "MVA",
"MXN", "MY", "MYMD", "NASA", "NASDA", "NATO", "NAV", "NBA", "NBC", "NCAN",
"NCR", "NEAR", "NEAT", "NEED", "NEVER", "NEW", "NEWS", "NEXT", "NFA", "NFC",
"NFL", "NFT", "NGAD", "NGMI", "NIGHT", "NIQ", "NK", "NO", "NOK", "NON",
"NONE", "NOOO", "NOPE", "NORTH", "NOT", "NOVA", "NOW", "NQ", "NRI", "NSA",
"NSCLC", "NSLC", "NTG", "NTVS", "NULL", "NUT", "NUTS", "NUTZ", "NVM", "NW",
"NY", "NYSE", "NZ", "NZD", "OBBB", "OBI", "OBS", "OBV", "OCD", "OCF",
"OCO", "ODAT", "ODTE", "OEM", "OF", "OFA", "OFF", "OG", "OH", "OK",
"OKAY", "OL", "OLD", "OMFG", "OMG", "ON", "ONDAS", "ONE", "ONLY", "OP",
"OPEC", "OPENQ", "OPEX", "OPRN", "OR", "ORB", "ORDER", "ORTEX", "OS", "OSCE",
"OT", "OTC", "OTM", "OTOH", "OUCH", "OUGHT", "OUR", "OUT", "OVER", "OWN",
"OZZY", "PA", "PANIC", "PC", "PDT", "PE", "PEAK", "PEG", "PETA", "PEW",
"PFC", "PGHL", "PIMCO", "PITA", "PLAN", "PLAYS", "PLC", "PLN", "PM", "PMCC",
"PMI", "PNL", "POC", "POMO", "POP", "POS", "POSCO", "POTUS", "POV", "POW",
"PPI", "PR", "PRICE", "PRIME", "PROFIT", "PROXY", "PS", "PSA", "PST", "PT",
"PTD", "PUSSY", "PUT", "PUTS", "PWC", "Q1", "Q2", "Q3", "Q4", "QE",
"QED", "QIMC", "QQQ", "QR", "RAM", "RATM", "RBA", "RBNZ", "RE", "REACH",
"READY", "REAL", "RED", "REIT", "REITS", "REKT", "REPE", "RFK", "RH", "RICO",
"RIDE", "RIGHT", "RIP", "RISK", "RISKY", "RNDC", "ROCE", "ROCK", "ROE", "ROFL",
"ROI", "ROIC", "ROTH", "RPO", "RRSP", "RSD", "RSI", "RT", "RTD", "RUB",
"RUG", "RULE", "RUST", "RVOL", "SAGA", "SALES", "SAME", "SAVE", "SAYS", "SBF",
"SBLOC", "SC", "SCALP", "SCAM", "SCHB", "SCIF", "SEC", "SEE", "SEK", "SELL",
"SELLL", "SEP", "SESG", "SET", "SFOR", "SGD", "SHALL", "SHARE", "SHEIN", "SHELL",
"SHIT", "SHORT", "SHOW", "SHS", "SHTF", "SI", "SICK", "SIGN", "SL", "SLIM",
"SLOW", "SMA", "SMALL", "SMFH", "SNZ", "SO", "SOLD", "SOLIS", "SOME", "SOON",
"SOOO", "SOUTH", "SP", "SPAC", "SPDR", "SPEND", "SPLG", "SPX", "SPY", "SQUAD",
"SS", "SSA", "SSDI", "START", "STAY", "STEEL", "STFU", "STILL", "STO", "STOCK",
"STOOQ", "STOP", "STOR", "STQQQ", "STUCK", "STUDY", "SUS", "SUSHI", "SUV", "SWIFT",
"SWING", "TA", "TAG", "TAKE", "TAM", "TBTH", "TEAMS", "TED", "TEMU", "TERM",
"TESLA", "TEXT", "TF", "TFNA", "TFSA", "THAN", "THANK", "THAT", "THATS", "THE",
"THEIR", "THEM", "THEN", "THERE", "THESE", "THEY", "THING", "THINK", "THIS", "TI",
"TIA", "TIKR", "TIME", "TIMES", "TINA", "TITS", "TJR", "TL", "TL;DR", "TLDR",
"TNT", "TO", "TODAY", "TOLD", "TONS", "TOO", "TOS", "TOT", "TOTAL", "TP",
"TPU", "TRADE", "TREND", "TRUE", "TRUMP", "TRUST", "TRY", "TSA", "TSMC", "TSP",
"TSX", "TSXV", "TTIP", "TTM", "TTYL", "TURNS", "TWO", "UAW", "UCITS", "UGH",
"UI", "UK", "UNDER", "UNITS", "UNO", "UNTIL", "UP", "US", "USA", "USD",
"USMCA", "USSA", "USSR", "UTC", "VALID", "VALUE", "VAMOS", "VAT", "VEO", "VERY",
"VFMXX", "VFV", "VI", "VISA", "VIX", "VLI", "VOO", "VP", "VPAY", "VR",
"VRVP", "VSUS", "VTI", "VUAG", "VW", "VWAP", "VWCE", "VXN", "VXUX", "WAGER",
"WAGMI", "WAIT", "WALL", "WANT", "WAS", "WATCH", "WAY", "WBTC", "WE", "WEB",
"WEB3", "WEEK", "WENT", "WERO", "WEST", "WHALE", "WHAT", "WHEN", "WHERE", "WHICH",
"WHILE", "WHO", "WHOS", "WHY", "WIDE", "WILL", "WIRE", "WIRED", "WITH", "WL",
"WON", "WOOPS", "WORDS", "WORTH", "WOULD", "WP", "WRONG", "WSB", "WSJ", "WTF",
"WV", "WWII", "WWIII", "X", "XAU", "XCUSE", "XD", "XEQT", "XI", "XIV",
"XMR", "XO", "XRP", "XX", "YEAH", "YEET", "YES", "YET", "YIELD", "YM",
"YMMV", "YOIR", "YOLO", "YOU", "YOUR", "YOY", "YT", "YTD", "YUGE", "YUPPP",
"ZAR", "ZEN", "ZERO", "ZEV"
"FXROX", "FY", "FYI", "FZROX", "GAAP", "GAIN", "GAV", "GAVE", "GBP", "GC",
"GDP", "GET", "GFC", "GG", "GGTM", "GIVES", "GJ", "GL", "GLHF", "GMAT",
"GMI", "GMT", "GO", "GOAL", "GOAT", "GOD", "GOING", "GOLD", "GONE", "GONNA",
"GOODS", "GOPRO", "GPT", "GPU", "GRAB", "GREAT", "GREEN", "GSOV", "GST", "GTA",
"GTC", "GTFO", "GTG", "GUH", "GUNS", "GUY", "GUYS", "HAD", "HAHA", "HALF",
"HAM", "HANDS", "HAS", "HATE", "HAVE", "HBAR", "HCOL", "HEAR", "HEDGE", "HEGE",
"HELD", "HELE", "HELL", "HELP", "HERE", "HEY", "HFCS", "HFT", "HGTV", "HIGH",
"HIGHS", "HINT", "HIS", "HITID", "HK", "HKD", "HKEX", "HODL", "HODOR", "HOF",
"HOLD", "HOLY", "HOME", "HOT", "HOUR", "HOURS", "HOW", "HS", "HSA", "HSI",
"HT", "HTCI", "HTF", "HTML", "HUF", "HUGE", "HV", "HYPE", "IANAL", "IATF",
"IB", "IBS", "ICSID", "ICT", "ID", "IDF", "IDK", "IF", "II", "IIRC",
"IKKE", "IKZ", "IM", "IMHO", "IMI", "IMO", "IN", "INC", "INR", "INTEL",
"INTO", "IP", "IPO", "IQVIA", "IRA", "IRAS", "IRC", "IRISH", "IRL", "IRMAA",
"IRS", "IS", "ISA", "ISIN", "ISM", "ISN", "IST", "IT", "ITC", "ITM",
"ITS", "ITWN", "IUIT", "IV", "IVV", "IWM", "IXL", "IXLH", "IYKYK", "JAVA",
"JD", "JDG", "JDM", "JE", "JFC", "JK", "JLR", "JMO", "JOBS", "JOIN",
"JOKE", "JP", "JPOW", "JPY", "JS", "JST", "JULY", "JUN", "JUST", "KARMA",
"KEEP", "KILL", "KING", "KK", "KLA", "KLP", "KNEW", "KNOW", "KO", "KOHLS",
"KPMG", "KRW", "LA", "LANGT", "LARGE", "LAST", "LATE", "LATER", "LBO", "LBTC",
"LCS", "LDL", "LEADS", "LEAP", "LEAPS", "LEARN", "LEGS", "LEI", "LET", "LETF",
"LETS", "LFA", "LFG", "LFP", "LG", "LGEN", "LID", "LIFE", "LIG", "LIGMA",
"LIKE", "LIMIT", "LIST", "LLC", "LLM", "LM", "LMAO", "LMAOO", "LMM", "LMN",
"LOANS", "LOKO", "LOL", "LOLOL", "LONG", "LONGS", "LOOK", "LOSE", "LOSS", "LOST",
"LOVE", "LOVES", "LOW", "LOWER", "LOWS", "LP", "LSS", "LTCG", "LUCID", "LUPD",
"LYC", "LYING", "M&A", "MA", "MACD", "MAIL", "MAKE", "MAKES", "MANGE", "MANY",
"MASON", "MAX", "MAY", "MAYBE", "MBA", "MC", "MCAP", "MCNA", "MCP", "ME",
"MEAN", "MEME", "MER", "MERGE", "MERK", "MES", "MEXC", "MF", "MFER", "MID",
"MIGHT", "MIN", "MIND", "MINS", "ML", "MLB", "MLS", "MM", "MMF", "MNQ",
"MOASS", "MODEL", "MODTX", "MOM", "MONEY", "MONGO", "MONTH", "MONY", "MOON", "MORE",
"MOST", "MOU", "MSK", "MTVGA", "MUCH", "MUSIC", "MUST", "MVA", "MXN", "MY",
"MYMD", "NASA", "NASDA", "NATO", "NAV", "NBA", "NBC", "NCAN", "NCR", "NEAR",
"NEAT", "NEED", "NEVER", "NEW", "NEWS", "NEXT", "NFA", "NFC", "NFL", "NFT",
"NGAD", "NGMI", "NIGHT", "NIQ", "NK", "NO", "NOK", "NON", "NONE", "NOOO",
"NOPE", "NORTH", "NOT", "NOVA", "NOW", "NQ", "NRI", "NSA", "NSCLC", "NSLC",
"NTG", "NTVS", "NULL", "NUT", "NUTS", "NUTZ", "NVIDIA", "NVM", "NW", "NY",
"NYSE", "NZ", "NZD", "OBBB", "OBI", "OBS", "OBV", "OCD", "OCF", "OCO",
"ODAT", "ODTE", "OEM", "OF", "OFA", "OFF", "OG", "OH", "OK", "OKAY",
"OL", "OLD", "OMFG", "OMG", "ON", "ONDAS", "ONE", "ONLY", "OP", "OPEC",
"OPENQ", "OPEX", "OPRN", "OR", "ORB", "ORDER", "ORTEX", "OS", "OSCE", "OSE",
"OSEBX", "OT", "OTC", "OTM", "OTOH", "OUCH", "OUGHT", "OUR", "OUT", "OVER",
"OWN", "OZZY", "PA", "PAID", "PANIC", "PC", "PDT", "PE", "PEAK", "PEG",
"PETA", "PEW", "PFC", "PGHL", "PIMCO", "PITA", "PLAN", "PLAYS", "PLC", "PLN",
"PM", "PMCC", "PMI", "PNL", "POC", "POMO", "POP", "POS", "POSCO", "POTUS",
"POV", "POW", "PPI", "PR", "PRICE", "PRIME", "PROFIT", "PROXY", "PS", "PSA",
"PST", "PT", "PTD", "PUSSY", "PUT", "PUTS", "PWC", "Q1", "Q2", "Q3",
"Q4", "QE", "QED", "QIMC", "QQQ", "QR", "RAM", "RATM", "RBA", "RBNZ",
"RE", "REACH", "READY", "REAL", "RED", "REIT", "REITS", "REKT", "REPE", "RFK",
"RH", "RICO", "RIDE", "RIGHT", "RIP", "RISK", "RISKY", "RNDC", "ROCE", "ROCK",
"ROE", "ROFL", "ROI", "ROIC", "ROTH", "RPO", "RRSP", "RSD", "RSI", "RT",
"RTD", "RUB", "RUG", "RULE", "RUST", "RVOL", "SAGA", "SALES", "SAME", "SAVE",
"SAYS", "SBF", "SBLOC", "SC", "SCALP", "SCAM", "SCHB", "SCIF", "SEC", "SEE",
"SEK", "SELL", "SELLL", "SEP", "SESG", "SET", "SFOR", "SGD", "SHALL", "SHARE",
"SHEIN", "SHELL", "SHIT", "SHORT", "SHOW", "SHS", "SHTF", "SI", "SICK", "SIGN",
"SL", "SLIM", "SLOW", "SMA", "SMALL", "SMFH", "SNZ", "SO", "SOLD", "SOLIS",
"SOME", "SOON", "SOOO", "SOUTH", "SP", "SPAC", "SPDR", "SPEND", "SPLG", "SPX",
"SPY", "SQUAD", "SS", "SSA", "SSDI", "START", "STAY", "STEEL", "STFU", "STILL",
"STO", "STOCK", "STOOQ", "STOP", "STOR", "STQQQ", "STUCK", "STUDY", "SUS", "SUSHI",
"SUV", "SWIFT", "SWING", "TA", "TAG", "TAKE", "TAM", "TBTH", "TEAMS", "TED",
"TEMU", "TERM", "TESLA", "TEXT", "TF", "TFNA", "TFSA", "THAN", "THANK", "THAT",
"THATS", "THE", "THEIR", "THEM", "THEN", "THERE", "THESE", "THEY", "THING", "THINK",
"THIS", "THROW", "TI", "TIA", "TIKR", "TIME", "TIMES", "TINA", "TITS", "TJR",
"TL", "TL;DR", "TLDR", "TNT", "TO", "TODAY", "TOLD", "TONS", "TOO", "TOS",
"TOT", "TOTAL", "TP", "TPU", "TRADE", "TREND", "TRUE", "TRUMP", "TRUST", "TRY",
"TSA", "TSMC", "TSP", "TSX", "TSXV", "TTIP", "TTM", "TTYL", "TURNS", "TWO",
"UAW", "UCITS", "UGH", "UI", "UK", "UNDER", "UNITS", "UNO", "UNTIL", "UP",
"US", "USA", "USD", "USMCA", "USSA", "USSR", "UTC", "VALID", "VALUE", "VAMOS",
"VAT", "VEIEN", "VEO", "VERY", "VFMXX", "VFV", "VI", "VISA", "VIX", "VLI",
"VOO", "VP", "VPAY", "VR", "VRVP", "VSUS", "VTI", "VUAG", "VW", "VWAP",
"VWCE", "VXN", "VXUX", "WAGER", "WAGMI", "WAIT", "WALL", "WANT", "WAS", "WATCH",
"WAY", "WBTC", "WE", "WEB", "WEB3", "WEEK", "WENT", "WERO", "WEST", "WHALE",
"WHAT", "WHEN", "WHERE", "WHICH", "WHILE", "WHO", "WHOS", "WHY", "WIDE", "WILL",
"WIRE", "WIRED", "WITH", "WL", "WON", "WOOPS", "WORDS", "WORTH", "WOULD", "WP",
"WRONG", "WSB", "WSJ", "WTF", "WV", "WWII", "WWIII", "X", "XAU", "XCUSE",
"XD", "XEQT", "XI", "XIV", "XMR", "XO", "XRP", "XX", "YEAH", "YEET",
"YES", "YET", "YIELD", "YM", "YMMV", "YOIR", "YOLO", "YOU", "YOUR", "YOY",
"YT", "YTD", "YUGE", "YUP", "YUPPP", "ZAR", "ZEN", "ZERO", "ZEV"
}
def format_and_print_list(word_set, words_per_line=10):

View File

@@ -65,75 +65,120 @@ def fetch_financial_data(ticker_symbol):
def _process_submission(submission, subreddit_id, conn, comment_limit):
"""
Processes a single Reddit submission using the "Golden Ticker" logic.
- Prioritizes tickers with a '$' prefix.
- Falls back to potential tickers only if no '$' tickers are found.
Processes a single Reddit submission with a more precise "Golden Ticker" logic.
- If a '$' ticker exists anywhere, the entire submission is in "Golden Only" mode.
- Falls back to potential tickers only if no '$' tickers are found anywhere.
"""
# 1. --- Golden Ticker Discovery ---
# First, search the entire post (title and body) for high-confidence '$' tickers.
# 1. --- Establish Mode: Golden or Potential ---
# Scan the entire submission (title + selftext) to determine the mode.
post_text_for_discovery = submission.title + " " + submission.selftext
golden_tickers = extract_golden_tickers(post_text_for_discovery)
tickers_in_title = set()
comment_only_tickers = set()
all_tickers_found_in_post = set()
golden_tickers_in_post = extract_golden_tickers(post_text_for_discovery)
# 2. --- Apply Contextual Logic ---
if golden_tickers:
# --- CASE A: Golden Tickers were found ---
log.info(f" -> Golden Ticker(s) Found: {', '.join(golden_tickers)}. Prioritizing these.")
all_tickers_found_in_post.update(golden_tickers)
# We only care about which of the golden tickers appeared in the title for the hybrid logic.
tickers_in_title = {ticker for ticker in golden_tickers if ticker in extract_golden_tickers(submission.title)}
is_golden_mode = bool(golden_tickers_in_post)
if is_golden_mode:
log.info(
f" -> Golden Ticker(s) Found: {', '.join(golden_tickers_in_post)}. Engaging Golden-Only Mode."
)
# In Golden Mode, we ONLY care about tickers with a '$'.
tickers_in_title = extract_golden_tickers(submission.title)
else:
# --- CASE B: No Golden Tickers, fall back to best-guess ---
log.info(" -> No Golden Tickers. Falling back to potential ticker search.")
# Now we search for potential tickers (e.g., 'GME' without a '$')
# In Potential Mode, we look for any valid-looking capitalized word.
tickers_in_title = extract_potential_tickers(submission.title)
all_tickers_found_in_post.update(tickers_in_title)
# 3. --- Mention Processing (This logic remains the same, but uses our cleanly identified tickers) ---
all_tickers_found_in_post = set(tickers_in_title)
ticker_id_cache = {}
# 2. --- Process Title Mentions ---
if tickers_in_title:
log.info(
f" -> Title Mention(s): {', '.join(tickers_in_title)}. Attributing all comments."
)
post_sentiment = get_sentiment_score(submission.title)
for ticker_symbol in tickers_in_title:
# All title tickers are saved as 'post' type mentions
ticker_id = database.get_or_create_entity(
conn, "tickers", "symbol", ticker_symbol
)
ticker_id_cache[ticker_symbol] = ticker_id
database.add_mention(
conn,
ticker_id,
subreddit_id,
submission.id,
"post",
int(submission.created_utc),
post_sentiment,
comment_id=None,
)
# 3. --- Process Comments (Single, Efficient Loop) ---
submission.comments.replace_more(limit=0)
all_comments = submission.comments.list()[:comment_limit]
# Process title mentions
if tickers_in_title:
log.info(f" -> Title Mention(s): {', '.join(tickers_in_title)}. Attributing all comments.")
post_sentiment = get_sentiment_score(submission.title)
for ticker_symbol in tickers_in_title:
ticker_id = database.get_or_create_entity(conn, 'tickers', 'symbol', ticker_symbol)
ticker_id_cache[ticker_symbol] = ticker_id
database.add_mention(conn, ticker_id, subreddit_id, submission.id, 'post', int(submission.created_utc), post_sentiment)
# Process comments
for comment in all_comments:
comment_sentiment = get_sentiment_score(comment.body)
if tickers_in_title:
# If the title had tickers, every comment is a mention for them.
# We don't need to scan the comment text for tickers here.
for ticker_symbol in tickers_in_title:
ticker_id = ticker_id_cache[ticker_symbol]
database.add_mention(conn, ticker_id, subreddit_id, submission.id, 'comment', int(comment.created_utc), comment_sentiment)
ticker_id = ticker_id_cache[ticker_symbol] # Guaranteed to be in cache
database.add_mention(
conn,
ticker_id,
subreddit_id,
submission.id,
"comment",
int(comment.created_utc),
comment_sentiment,
comment_id=comment.id,
)
else:
# If no title tickers, we must scan comments for potential tickers
tickers_in_comment = extract_potential_tickers(comment.body)
# If no title tickers, we must scan the comment for direct mentions.
# The type of ticker we look for depends on the mode.
if is_golden_mode:
# This case is rare (no golden in title, but some in comments) but important.
tickers_in_comment = extract_golden_tickers(comment.body)
else:
tickers_in_comment = extract_potential_tickers(comment.body)
if tickers_in_comment:
all_tickers_found_in_post.update(tickers_in_comment)
for ticker_symbol in tickers_in_comment:
ticker_id = database.get_or_create_entity(conn, 'tickers', 'symbol', ticker_symbol)
database.add_mention(conn, ticker_id, subreddit_id, submission.id, 'comment', int(comment.created_utc), comment_sentiment)
ticker_id = database.get_or_create_entity(
conn, "tickers", "symbol", ticker_symbol
)
database.add_mention(
conn,
ticker_id,
subreddit_id,
submission.id,
"comment",
int(comment.created_utc),
comment_sentiment,
comment_id=comment.id,
)
# 4. --- Save Deep Dive and Return Tickers for Financial Update ---
# (This part is unchanged)
# 4. --- Save Deep Dive Analysis ---
all_comment_sentiments = [get_sentiment_score(c.body) for c in all_comments]
avg_sentiment = sum(all_comment_sentiments) / len(all_comment_sentiments) if all_comment_sentiments else 0
avg_sentiment = (
sum(all_comment_sentiments) / len(all_comment_sentiments)
if all_comment_sentiments
else 0
)
post_analysis_data = {
"post_id": submission.id, "title": submission.title,
"post_url": f"https://reddit.com{submission.permalink}", "subreddit_id": subreddit_id,
"post_timestamp": int(submission.created_utc), "comment_count": len(all_comments),
"avg_comment_sentiment": avg_sentiment
"post_id": submission.id,
"title": submission.title,
"post_url": f"https://reddit.com{submission.permalink}",
"subreddit_id": subreddit_id,
"post_timestamp": int(submission.created_utc),
"comment_count": len(all_comments),
"avg_comment_sentiment": avg_sentiment,
}
database.add_or_update_post_analysis(conn, post_analysis_data)
return all_tickers_found_in_post

View File

@@ -7,116 +7,118 @@ import re
COMMON_WORDS_BLACKLIST = {
"401K", "403B", "457B", "AAVE", "ABC", "ABOUT", "ABOVE", "ACAT", "ADAM", "ADHD",
"ADR", "ADS", "ADX", "AEDT", "AEST", "AF", "AFAIK", "AFTER", "AGENT", "AH",
"AI", "AINT", "AK", "ALD", "ALGOS", "ALIVE", "ALL", "ALPHA", "ALSO", "AM",
"AMA", "AMEX", "AMK", "AMY", "AND", "ANSS", "ANY", "APES", "APL", "APPL",
"APPLE", "APR", "APUS", "APY", "AR", "ARBK", "ARE", "AREA", "ARH", "ARK",
"AROUND", "ART", "AS", "ASAP", "ASEAN", "ASK", "ASS", "ASSET", "AST", "AT",
"ATH", "ATL", "ATM", "AUD", "AUG", "AUM", "AV", "AVG", "AWS", "BABY",
"BAG", "BAGS", "BALLS", "BAN", "BANG", "BASIC", "BBB", "BBBY", "BE", "BEAR",
"BEARS", "BECN", "BEER", "BELL", "BELOW", "BETA", "BETS", "BF", "BID", "BIG",
"BIS", "BITCH", "BKEY", "BLEND", "BMW", "BNP", "BNPL", "BOE", "BOJ", "BOLL",
"BOMB", "BOND", "BONED", "BORN", "BOTH", "BOTS", "BOY", "BOYS", "BRB", "BRICS",
"BRK", "BRKA", "BRKB", "BRL", "BROKE", "BRRRR", "BS", "BSE", "BST", "BSU",
"BT", "BTC", "BTS", "BTW", "BUDDY", "BULL", "BULLS", "BUST", "BUT", "BUY",
"BUZZ", "CAD", "CAFE", "CAGR", "CALL", "CALLS", "CAN", "CAP", "CARB", "CARES",
"CASE", "CATL", "CBD", "CBGM", "CBS", "CCI", "CCP", "CD", "CDN", "CEO",
"CEST", "CET", "CEX", "CFD", "CFO", "CFPB", "CHART", "CHASE", "CHATS", "CHECK",
"CHF", "CHICK", "CHIP", "CHIPS", "CIA", "CIC", "CLAIM", "CLEAN", "CLICK", "CLOSE",
"CMON", "CN", "CNBC", "CNN", "CNY", "COBRA", "COCK", "COGS", "COIL", "COKE",
"COME", "COST", "COULD", "COVID", "CPAP", "CPI", "CRA", "CRE", "CRO", "CRV",
"CSE", "CSP", "CSS", "CST", "CTB", "CTEP", "CTO", "CUCKS", "CULT", "CUM",
"CUSMA", "CUTS", "CUV", "CYCLE", "CZK", "DA", "DAILY", "DAO", "DATE", "DAX",
"DAY", "DAYS", "DCA", "DCF", "DD", "DEAL", "DEBT", "DEEZ", "DEMO", "DET",
"DEX", "DGAF", "DIA", "DID", "DIDNT", "DIP", "DITM", "DIV", "DIY", "DJI",
"DJIA", "DJTJ", "DKK", "DL", "DM", "DMV", "DNI", "DNUTZ", "DO", "DOD",
"DOE", "DOES", "DOGE", "DOING", "DOJ", "DOM", "DONNY", "DONT", "DONUT", "DOOR",
"DOWN", "DOZEN", "DPI", "DR", "DUDE", "DUMP", "DUNT", "DUT", "DUTY", "DXY",
"DXYXBT", "DYI", "DYNK", "DYODD", "DYOR", "EACH", "EARLY", "EARN", "EAST", "EASY",
"ECB", "EDGAR", "EDIT", "EDT", "EJ", "EMA", "EMJ", "EMT", "END", "ENRON",
"ENSI", "ENV", "EO", "EOD", "EOM", "EOW", "EOY", "EPA", "EPK", "EPS",
"ER", "ESG", "ESPP", "EST", "ETA", "ETF", "ETFS", "ETH", "ETL", "EU",
"EUR", "EV", "EVEN", "EVERY", "EVTOL", "EXTRA", "EYES", "EZ", "FAANG", "FAFO",
"FAQ", "FAR", "FAST", "FBI", "FCC", "FCFF", "FD", "FDA", "FEE", "FFH",
"FFS", "FGMA", "FIG", "FIGMA", "FIHTX", "FILES", "FINAL", "FIND", "FING", "FINRA",
"FINT", "FINTX", "FINTY", "FIRE", "FIRST", "FKIN", "FLRAA", "FLT", "FLY", "FML",
"AI", "AINT", "AK", "AKSJE", "ALD", "ALGOS", "ALIVE", "ALL", "ALPHA", "ALSO",
"AM", "AMA", "AMEX", "AMK", "AMY", "AND", "ANSS", "ANY", "APES", "APL",
"APPL", "APPLE", "APR", "APUS", "APY", "AR", "ARBK", "ARE", "AREA", "ARH",
"ARK", "AROUND", "ART", "AS", "ASAP", "ASEAN", "ASK", "ASS", "ASSET", "AST",
"AT", "ATH", "ATL", "ATM", "AUD", "AUG", "AUM", "AV", "AVG", "AWS",
"BABY", "BAD", "BAG", "BAGS", "BALLS", "BAN", "BANG", "BASIC", "BBB", "BBBY",
"BE", "BEAR", "BEARS", "BECN", "BEER", "BELL", "BELOW", "BETA", "BETS", "BF",
"BID", "BIG", "BIS", "BITCH", "BKEY", "BLEND", "BLOW", "BMW", "BNP", "BNPL",
"BOARD", "BOE", "BOJ", "BOLL", "BOMB", "BOND", "BONED", "BORN", "BOTH", "BOTS",
"BOY", "BOYS", "BRB", "BRICS", "BRK", "BRKA", "BRKB", "BRL", "BROKE", "BRRRR",
"BS", "BSE", "BST", "BSU", "BT", "BTC", "BTS", "BTW", "BUDDY", "BULL",
"BULLS", "BUST", "BUT", "BUY", "BUZZ", "CAD", "CAFE", "CAGR", "CALL", "CALLS",
"CAN", "CAP", "CARB", "CARES", "CASE", "CATL", "CBD", "CBGM", "CBS", "CCI",
"CCP", "CD", "CDN", "CEO", "CEST", "CET", "CEX", "CFD", "CFO", "CFPB",
"CHART", "CHASE", "CHATS", "CHECK", "CHF", "CHICK", "CHIP", "CHIPS", "CIA", "CIC",
"CLAIM", "CLEAN", "CLICK", "CLOSE", "CMON", "CN", "CNBC", "CNN", "CNY", "COBRA",
"COCK", "COGS", "COIL", "COKE", "COME", "COST", "COULD", "COVID", "CPAP", "CPI",
"CRA", "CRE", "CRO", "CRV", "CSE", "CSP", "CSS", "CST", "CTB", "CTEP",
"CTO", "CUCKS", "CULT", "CUM", "CUSMA", "CUTS", "CUV", "CYCLE", "CZK", "DA",
"DAILY", "DAO", "DART", "DATA", "DATE", "DAX", "DAY", "DAYS", "DCA", "DCF",
"DD", "DEAL", "DEBT", "DEEZ", "DEMO", "DET", "DEX", "DGAF", "DIA", "DID",
"DIDNT", "DIP", "DITM", "DIV", "DIY", "DJI", "DJIA", "DJTJ", "DKK", "DL",
"DM", "DMV", "DNI", "DNUTZ", "DO", "DOD", "DOE", "DOES", "DOGE", "DOING",
"DOJ", "DOM", "DONNY", "DONT", "DONUT", "DOOR", "DOWN", "DOZEN", "DPI", "DR",
"DUDE", "DUMP", "DUNT", "DUT", "DUTY", "DXY", "DXYXBT", "DYI", "DYNK", "DYODD",
"DYOR", "EACH", "EARLY", "EARN", "EAST", "EASY", "EBIT", "ECB", "EDGAR", "EDIT",
"EDT", "EJ", "EMA", "EMJ", "EMT", "END", "ENRON", "ENSI", "ENV", "EO",
"EOD", "EOM", "EOW", "EOY", "EPA", "EPK", "EPS", "ER", "ESG", "ESPP",
"EST", "ETA", "ETF", "ETFS", "ETH", "ETHT", "ETL", "EU", "EUR", "EV",
"EVEN", "EVERY", "EVTOL", "EXTRA", "EYES", "EZ", "FAANG", "FAFO", "FAQ", "FAR",
"FAST", "FBI", "FCC", "FCFF", "FD", "FDA", "FED", "FEE", "FFH", "FFS",
"FGMA", "FIG", "FIGMA", "FIHTX", "FILES", "FINAL", "FIND", "FING", "FINRA", "FINT",
"FINTX", "FINTY", "FIRE", "FIRST", "FKIN", "FLOAT", "FLRAA", "FLT", "FLY", "FML",
"FOLO", "FOMC", "FOMO", "FOR", "FOREX", "FRAUD", "FREAK", "FRED", "FRG", "FROM",
"FRP", "FRS", "FSBO", "FSD", "FSE", "FSELK", "FSPSX", "FTD", "FTSE", "FUCK",
"FUCKS", "FUD", "FULL", "FUND", "FUNNY", "FVG", "FWIW", "FX", "FXAIX", "FXIAX",
"FXROX", "FY", "FYI", "FZROX", "GAAP", "GAIN", "GAVE", "GBP", "GC", "GDP",
"GET", "GFC", "GG", "GGTM", "GIVES", "GJ", "GL", "GLHF", "GMAT", "GMI",
"GMT", "GO", "GOAL", "GOAT", "GOD", "GOING", "GOLD", "GONE", "GONNA", "GOODS",
"GOPRO", "GPT", "GPU", "GRAB", "GREAT", "GREEN", "GSOV", "GST", "GTA", "GTC",
"GTFO", "GTG", "GUH", "GUNS", "GUY", "GUYS", "HAD", "HAHA", "HALF", "HAM",
"HANDS", "HAS", "HATE", "HAVE", "HBAR", "HCOL", "HEAR", "HEDGE", "HEGE", "HELD",
"HELL", "HELP", "HERE", "HEY", "HFCS", "HFT", "HGTV", "HIGH", "HIGHS", "HINT",
"HIS", "HITID", "HK", "HKD", "HKEX", "HODL", "HODOR", "HOF", "HOLD", "HOLY",
"HOME", "HOT", "HOUR", "HOURS", "HOW", "HS", "HSA", "HSI", "HT", "HTCI",
"HTF", "HTML", "HUF", "HUGE", "HV", "HYPE", "IANAL", "IATF", "IB", "IBS",
"ICSID", "ICT", "ID", "IDF", "IDK", "IF", "II", "IIRC", "IKKE", "IKZ",
"IM", "IMHO", "IMI", "IMO", "IN", "INC", "INR", "INTEL", "INTO", "IP",
"IPO", "IQVIA", "IRA", "IRAS", "IRC", "IRISH", "IRMAA", "IRS", "IS", "ISA",
"ISIN", "ISM", "ISN", "IST", "IT", "ITC", "ITM", "ITS", "ITWN", "IUIT",
"IV", "IVV", "IWM", "IXL", "IXLH", "IYKYK", "JAVA", "JD", "JDG", "JDM",
"JE", "JFC", "JK", "JLR", "JMO", "JOBS", "JOIN", "JOKE", "JP", "JPOW",
"JPY", "JS", "JST", "JUN", "JUST", "KARMA", "KEEP", "KILL", "KING", "KK",
"KLA", "KLP", "KNEW", "KNOW", "KO", "KOHLS", "KPMG", "KRW", "LA", "LANGT",
"LARGE", "LAST", "LATE", "LATER", "LBO", "LBTC", "LCS", "LDL", "LEADS", "LEAP",
"LEAPS", "LEARN", "LEI", "LET", "LETF", "LETS", "LFA", "LFG", "LFP", "LG",
"LGEN", "LIFE", "LIG", "LIGMA", "LIKE", "LIMIT", "LIST", "LLC", "LLM", "LM",
"LMAO", "LMAOO", "LMM", "LMN", "LOANS", "LOKO", "LOL", "LOLOL", "LONG", "LONGS",
"LOOK", "LOSE", "LOSS", "LOST", "LOVE", "LOVES", "LOW", "LOWER", "LOWS", "LP",
"LSS", "LTCG", "LUCID", "LUPD", "LYC", "LYING", "M&A", "MA", "MACD", "MAIL",
"MAKE", "MAKES", "MANGE", "MANY", "MASON", "MAX", "MAY", "MAYBE", "MBA", "MC",
"MCAP", "MCNA", "MCP", "ME", "MEAN", "MEME", "MERGE", "MERK", "MES", "MEXC",
"MF", "MFER", "MID", "MIGHT", "MIN", "MIND", "MINS", "ML", "MLB", "MLS",
"MM", "MMF", "MNQ", "MOASS", "MODEL", "MODTX", "MOM", "MONEY", "MONTH", "MONY",
"MOON", "MORE", "MOST", "MOU", "MSK", "MTVGA", "MUCH", "MUSIC", "MUST", "MVA",
"MXN", "MY", "MYMD", "NASA", "NASDA", "NATO", "NAV", "NBA", "NBC", "NCAN",
"NCR", "NEAR", "NEAT", "NEED", "NEVER", "NEW", "NEWS", "NEXT", "NFA", "NFC",
"NFL", "NFT", "NGAD", "NGMI", "NIGHT", "NIQ", "NK", "NO", "NOK", "NON",
"NONE", "NOOO", "NOPE", "NORTH", "NOT", "NOVA", "NOW", "NQ", "NRI", "NSA",
"NSCLC", "NSLC", "NTG", "NTVS", "NULL", "NUT", "NUTS", "NUTZ", "NVM", "NW",
"NY", "NYSE", "NZ", "NZD", "OBBB", "OBI", "OBS", "OBV", "OCD", "OCF",
"OCO", "ODAT", "ODTE", "OEM", "OF", "OFA", "OFF", "OG", "OH", "OK",
"OKAY", "OL", "OLD", "OMFG", "OMG", "ON", "ONDAS", "ONE", "ONLY", "OP",
"OPEC", "OPENQ", "OPEX", "OPRN", "OR", "ORB", "ORDER", "ORTEX", "OS", "OSCE",
"OT", "OTC", "OTM", "OTOH", "OUCH", "OUGHT", "OUR", "OUT", "OVER", "OWN",
"OZZY", "PA", "PANIC", "PC", "PDT", "PE", "PEAK", "PEG", "PETA", "PEW",
"PFC", "PGHL", "PIMCO", "PITA", "PLAN", "PLAYS", "PLC", "PLN", "PM", "PMCC",
"PMI", "PNL", "POC", "POMO", "POP", "POS", "POSCO", "POTUS", "POV", "POW",
"PPI", "PR", "PRICE", "PRIME", "PROFIT", "PROXY", "PS", "PSA", "PST", "PT",
"PTD", "PUSSY", "PUT", "PUTS", "PWC", "Q1", "Q2", "Q3", "Q4", "QE",
"QED", "QIMC", "QQQ", "QR", "RAM", "RATM", "RBA", "RBNZ", "RE", "REACH",
"READY", "REAL", "RED", "REIT", "REITS", "REKT", "REPE", "RFK", "RH", "RICO",
"RIDE", "RIGHT", "RIP", "RISK", "RISKY", "RNDC", "ROCE", "ROCK", "ROE", "ROFL",
"ROI", "ROIC", "ROTH", "RPO", "RRSP", "RSD", "RSI", "RT", "RTD", "RUB",
"RUG", "RULE", "RUST", "RVOL", "SAGA", "SALES", "SAME", "SAVE", "SAYS", "SBF",
"SBLOC", "SC", "SCALP", "SCAM", "SCHB", "SCIF", "SEC", "SEE", "SEK", "SELL",
"SELLL", "SEP", "SESG", "SET", "SFOR", "SGD", "SHALL", "SHARE", "SHEIN", "SHELL",
"SHIT", "SHORT", "SHOW", "SHS", "SHTF", "SI", "SICK", "SIGN", "SL", "SLIM",
"SLOW", "SMA", "SMALL", "SMFH", "SNZ", "SO", "SOLD", "SOLIS", "SOME", "SOON",
"SOOO", "SOUTH", "SP", "SPAC", "SPDR", "SPEND", "SPLG", "SPX", "SPY", "SQUAD",
"SS", "SSA", "SSDI", "START", "STAY", "STEEL", "STFU", "STILL", "STO", "STOCK",
"STOOQ", "STOP", "STOR", "STQQQ", "STUCK", "STUDY", "SUS", "SUSHI", "SUV", "SWIFT",
"SWING", "TA", "TAG", "TAKE", "TAM", "TBTH", "TEAMS", "TED", "TEMU", "TERM",
"TESLA", "TEXT", "TF", "TFNA", "TFSA", "THAN", "THANK", "THAT", "THATS", "THE",
"THEIR", "THEM", "THEN", "THERE", "THESE", "THEY", "THING", "THINK", "THIS", "TI",
"TIA", "TIKR", "TIME", "TIMES", "TINA", "TITS", "TJR", "TL", "TL;DR", "TLDR",
"TNT", "TO", "TODAY", "TOLD", "TONS", "TOO", "TOS", "TOT", "TOTAL", "TP",
"TPU", "TRADE", "TREND", "TRUE", "TRUMP", "TRUST", "TRY", "TSA", "TSMC", "TSP",
"TSX", "TSXV", "TTIP", "TTM", "TTYL", "TURNS", "TWO", "UAW", "UCITS", "UGH",
"UI", "UK", "UNDER", "UNITS", "UNO", "UNTIL", "UP", "US", "USA", "USD",
"USMCA", "USSA", "USSR", "UTC", "VALID", "VALUE", "VAMOS", "VAT", "VEO", "VERY",
"VFMXX", "VFV", "VI", "VISA", "VIX", "VLI", "VOO", "VP", "VPAY", "VR",
"VRVP", "VSUS", "VTI", "VUAG", "VW", "VWAP", "VWCE", "VXN", "VXUX", "WAGER",
"WAGMI", "WAIT", "WALL", "WANT", "WAS", "WATCH", "WAY", "WBTC", "WE", "WEB",
"WEB3", "WEEK", "WENT", "WERO", "WEST", "WHALE", "WHAT", "WHEN", "WHERE", "WHICH",
"WHILE", "WHO", "WHOS", "WHY", "WIDE", "WILL", "WIRE", "WIRED", "WITH", "WL",
"WON", "WOOPS", "WORDS", "WORTH", "WOULD", "WP", "WRONG", "WSB", "WSJ", "WTF",
"WV", "WWII", "WWIII", "X", "XAU", "XCUSE", "XD", "XEQT", "XI", "XIV",
"XMR", "XO", "XRP", "XX", "YEAH", "YEET", "YES", "YET", "YIELD", "YM",
"YMMV", "YOIR", "YOLO", "YOU", "YOUR", "YOY", "YT", "YTD", "YUGE", "YUPPP",
"ZAR", "ZEN", "ZERO", "ZEV"
"FXROX", "FY", "FYI", "FZROX", "GAAP", "GAIN", "GAV", "GAVE", "GBP", "GC",
"GDP", "GET", "GFC", "GG", "GGTM", "GIVES", "GJ", "GL", "GLHF", "GMAT",
"GMI", "GMT", "GO", "GOAL", "GOAT", "GOD", "GOING", "GOLD", "GONE", "GONNA",
"GOODS", "GOPRO", "GPT", "GPU", "GRAB", "GREAT", "GREEN", "GSOV", "GST", "GTA",
"GTC", "GTFO", "GTG", "GUH", "GUNS", "GUY", "GUYS", "HAD", "HAHA", "HALF",
"HAM", "HANDS", "HAS", "HATE", "HAVE", "HBAR", "HCOL", "HEAR", "HEDGE", "HEGE",
"HELD", "HELE", "HELL", "HELP", "HERE", "HEY", "HFCS", "HFT", "HGTV", "HIGH",
"HIGHS", "HINT", "HIS", "HITID", "HK", "HKD", "HKEX", "HODL", "HODOR", "HOF",
"HOLD", "HOLY", "HOME", "HOT", "HOUR", "HOURS", "HOW", "HS", "HSA", "HSI",
"HT", "HTCI", "HTF", "HTML", "HUF", "HUGE", "HV", "HYPE", "IANAL", "IATF",
"IB", "IBS", "ICSID", "ICT", "ID", "IDF", "IDK", "IF", "II", "IIRC",
"IKKE", "IKZ", "IM", "IMHO", "IMI", "IMO", "IN", "INC", "INR", "INTEL",
"INTO", "IP", "IPO", "IQVIA", "IRA", "IRAS", "IRC", "IRISH", "IRL", "IRMAA",
"IRS", "IS", "ISA", "ISIN", "ISM", "ISN", "IST", "IT", "ITC", "ITM",
"ITS", "ITWN", "IUIT", "IV", "IVV", "IWM", "IXL", "IXLH", "IYKYK", "JAVA",
"JD", "JDG", "JDM", "JE", "JFC", "JK", "JLR", "JMO", "JOBS", "JOIN",
"JOKE", "JP", "JPOW", "JPY", "JS", "JST", "JULY", "JUN", "JUST", "KARMA",
"KEEP", "KILL", "KING", "KK", "KLA", "KLP", "KNEW", "KNOW", "KO", "KOHLS",
"KPMG", "KRW", "LA", "LANGT", "LARGE", "LAST", "LATE", "LATER", "LBO", "LBTC",
"LCS", "LDL", "LEADS", "LEAP", "LEAPS", "LEARN", "LEGS", "LEI", "LET", "LETF",
"LETS", "LFA", "LFG", "LFP", "LG", "LGEN", "LID", "LIFE", "LIG", "LIGMA",
"LIKE", "LIMIT", "LIST", "LLC", "LLM", "LM", "LMAO", "LMAOO", "LMM", "LMN",
"LOANS", "LOKO", "LOL", "LOLOL", "LONG", "LONGS", "LOOK", "LOSE", "LOSS", "LOST",
"LOVE", "LOVES", "LOW", "LOWER", "LOWS", "LP", "LSS", "LTCG", "LUCID", "LUPD",
"LYC", "LYING", "M&A", "MA", "MACD", "MAIL", "MAKE", "MAKES", "MANGE", "MANY",
"MASON", "MAX", "MAY", "MAYBE", "MBA", "MC", "MCAP", "MCNA", "MCP", "ME",
"MEAN", "MEME", "MER", "MERGE", "MERK", "MES", "MEXC", "MF", "MFER", "MID",
"MIGHT", "MIN", "MIND", "MINS", "ML", "MLB", "MLS", "MM", "MMF", "MNQ",
"MOASS", "MODEL", "MODTX", "MOM", "MONEY", "MONGO", "MONTH", "MONY", "MOON", "MORE",
"MOST", "MOU", "MSK", "MTVGA", "MUCH", "MUSIC", "MUST", "MVA", "MXN", "MY",
"MYMD", "NASA", "NASDA", "NATO", "NAV", "NBA", "NBC", "NCAN", "NCR", "NEAR",
"NEAT", "NEED", "NEVER", "NEW", "NEWS", "NEXT", "NFA", "NFC", "NFL", "NFT",
"NGAD", "NGMI", "NIGHT", "NIQ", "NK", "NO", "NOK", "NON", "NONE", "NOOO",
"NOPE", "NORTH", "NOT", "NOVA", "NOW", "NQ", "NRI", "NSA", "NSCLC", "NSLC",
"NTG", "NTVS", "NULL", "NUT", "NUTS", "NUTZ", "NVIDIA", "NVM", "NW", "NY",
"NYSE", "NZ", "NZD", "OBBB", "OBI", "OBS", "OBV", "OCD", "OCF", "OCO",
"ODAT", "ODTE", "OEM", "OF", "OFA", "OFF", "OG", "OH", "OK", "OKAY",
"OL", "OLD", "OMFG", "OMG", "ON", "ONDAS", "ONE", "ONLY", "OP", "OPEC",
"OPENQ", "OPEX", "OPRN", "OR", "ORB", "ORDER", "ORTEX", "OS", "OSCE", "OSE",
"OSEBX", "OT", "OTC", "OTM", "OTOH", "OUCH", "OUGHT", "OUR", "OUT", "OVER",
"OWN", "OZZY", "PA", "PAID", "PANIC", "PC", "PDT", "PE", "PEAK", "PEG",
"PETA", "PEW", "PFC", "PGHL", "PIMCO", "PITA", "PLAN", "PLAYS", "PLC", "PLN",
"PM", "PMCC", "PMI", "PNL", "POC", "POMO", "POP", "POS", "POSCO", "POTUS",
"POV", "POW", "PPI", "PR", "PRICE", "PRIME", "PROFIT", "PROXY", "PS", "PSA",
"PST", "PT", "PTD", "PUSSY", "PUT", "PUTS", "PWC", "Q1", "Q2", "Q3",
"Q4", "QE", "QED", "QIMC", "QQQ", "QR", "RAM", "RATM", "RBA", "RBNZ",
"RE", "REACH", "READY", "REAL", "RED", "REIT", "REITS", "REKT", "REPE", "RFK",
"RH", "RICO", "RIDE", "RIGHT", "RIP", "RISK", "RISKY", "RNDC", "ROCE", "ROCK",
"ROE", "ROFL", "ROI", "ROIC", "ROTH", "RPO", "RRSP", "RSD", "RSI", "RT",
"RTD", "RUB", "RUG", "RULE", "RUST", "RVOL", "SAGA", "SALES", "SAME", "SAVE",
"SAYS", "SBF", "SBLOC", "SC", "SCALP", "SCAM", "SCHB", "SCIF", "SEC", "SEE",
"SEK", "SELL", "SELLL", "SEP", "SESG", "SET", "SFOR", "SGD", "SHALL", "SHARE",
"SHEIN", "SHELL", "SHIT", "SHORT", "SHOW", "SHS", "SHTF", "SI", "SICK", "SIGN",
"SL", "SLIM", "SLOW", "SMA", "SMALL", "SMFH", "SNZ", "SO", "SOLD", "SOLIS",
"SOME", "SOON", "SOOO", "SOUTH", "SP", "SPAC", "SPDR", "SPEND", "SPLG", "SPX",
"SPY", "SQUAD", "SS", "SSA", "SSDI", "START", "STAY", "STEEL", "STFU", "STILL",
"STO", "STOCK", "STOOQ", "STOP", "STOR", "STQQQ", "STUCK", "STUDY", "SUS", "SUSHI",
"SUV", "SWIFT", "SWING", "TA", "TAG", "TAKE", "TAM", "TBTH", "TEAMS", "TED",
"TEMU", "TERM", "TESLA", "TEXT", "TF", "TFNA", "TFSA", "THAN", "THANK", "THAT",
"THATS", "THE", "THEIR", "THEM", "THEN", "THERE", "THESE", "THEY", "THING", "THINK",
"THIS", "THROW", "TI", "TIA", "TIKR", "TIME", "TIMES", "TINA", "TITS", "TJR",
"TL", "TL;DR", "TLDR", "TNT", "TO", "TODAY", "TOLD", "TONS", "TOO", "TOS",
"TOT", "TOTAL", "TP", "TPU", "TRADE", "TREND", "TRUE", "TRUMP", "TRUST", "TRY",
"TSA", "TSMC", "TSP", "TSX", "TSXV", "TTIP", "TTM", "TTYL", "TURNS", "TWO",
"UAW", "UCITS", "UGH", "UI", "UK", "UNDER", "UNITS", "UNO", "UNTIL", "UP",
"US", "USA", "USD", "USMCA", "USSA", "USSR", "UTC", "VALID", "VALUE", "VAMOS",
"VAT", "VEIEN", "VEO", "VERY", "VFMXX", "VFV", "VI", "VISA", "VIX", "VLI",
"VOO", "VP", "VPAY", "VR", "VRVP", "VSUS", "VTI", "VUAG", "VW", "VWAP",
"VWCE", "VXN", "VXUX", "WAGER", "WAGMI", "WAIT", "WALL", "WANT", "WAS", "WATCH",
"WAY", "WBTC", "WE", "WEB", "WEB3", "WEEK", "WENT", "WERO", "WEST", "WHALE",
"WHAT", "WHEN", "WHERE", "WHICH", "WHILE", "WHO", "WHOS", "WHY", "WIDE", "WILL",
"WIRE", "WIRED", "WITH", "WL", "WON", "WOOPS", "WORDS", "WORTH", "WOULD", "WP",
"WRONG", "WSB", "WSJ", "WTF", "WV", "WWII", "WWIII", "X", "XAU", "XCUSE",
"XD", "XEQT", "XI", "XIV", "XMR", "XO", "XRP", "XX", "YEAH", "YEET",
"YES", "YET", "YIELD", "YM", "YMMV", "YOIR", "YOLO", "YOU", "YOUR", "YOY",
"YT", "YTD", "YUGE", "YUP", "YUPPP", "ZAR", "ZEN", "ZERO", "ZEV"
}
def extract_golden_tickers(text):

View File

@@ -7,7 +7,7 @@ with open("requirements.txt") as f:
setup(
name="reddit-stock-analyzer",
version="0.0.1",
version="0.0.2",
author="Pål-Kristian Hamre",
author_email="its@pkhamre.com",
description="A command-line tool to analyze stock ticker mentions on Reddit.",
@@ -20,6 +20,7 @@ setup(
"rstat=rstat_tool.main:main",
"rstat-dashboard=rstat_tool.dashboard:start_dashboard",
"rstat-cleanup=rstat_tool.cleanup:run_cleanup",
"rstat-flairs=rstat_tool.flair_finder:main",
],
},
)

View File

@@ -49,7 +49,7 @@
<div class="text-center">Mentions</div>
<div class="text-center">Sentiment</div>
<div>Mkt Cap</div>
<div>Close Price</div>
<div>Last Price</div>
</div>
</div>
@@ -96,11 +96,10 @@
<div class="text-lg font-semibold text-white">{{ ticker.market_cap | format_mc }}</div>
</div>
<div>
<div class="sm:hidden text-xs font-bold text-slate-500 uppercase tracking-wider mb-1">Close
Price</div>
<div class="sm:hidden text-xs font-bold text-slate-500 uppercase tracking-wider mb-1">Last Price</div>
<div class="text-lg font-semibold text-white">
{% if ticker.closing_price %}<a
href="https://finance.yahoo.com/quote/{{ ticker.symbol }}" target="_blank"
href="https://www.marketwatch.com/investing/stock/{{ ticker.symbol }}" target="_blank"
class="hover:text-blue-400 transition-colors">${{
"%.2f"|format(ticker.closing_price) }}</a>
{% else %}N/A{% endif %}