62 lines
1.8 KiB
Python
62 lines
1.8 KiB
Python
from webhook import WebhookNotifier
|
|
from app import (
|
|
Application,
|
|
RedditMonitor,
|
|
ApiRequestHandler,
|
|
PostManager,
|
|
PostAnalyticsManager,
|
|
SubmissionManager,
|
|
)
|
|
from config import Config
|
|
from app_log import LoggingManager
|
|
|
|
|
|
if __name__ == "__main__":
|
|
log_manager = LoggingManager("scraper.log")
|
|
client_id = Config.PRAW_CLIENT_ID
|
|
client_secret = Config.PRAW_CLIENT_SECRET
|
|
user_agent = Config.USER_AGENT
|
|
username = Config.PRAW_USERNAME
|
|
password = Config.PRAW_PASSWORD
|
|
subreddit_name = Config.SUBREDDIT_NAME
|
|
discord_webhook_url = Config.POKEMANS_WEBHOOK_URL
|
|
disable_webhook = Config.DISABLE_WEBHOOK
|
|
pkmn_env = Config.PKMN_ENV
|
|
api_url = Config.API_URL
|
|
|
|
reddit_monitor = RedditMonitor(
|
|
client_id, client_secret, user_agent, username, password, subreddit_name
|
|
)
|
|
webhook_notifier = WebhookNotifier(discord_webhook_url, disable_webhook)
|
|
api_conn = ApiRequestHandler(api_url)
|
|
post_manager = PostManager(api_conn)
|
|
post_analytics_manager = PostAnalyticsManager(api_conn, post_manager)
|
|
submission_manager = SubmissionManager(
|
|
reddit_monitor, post_manager, post_analytics_manager, webhook_notifier
|
|
)
|
|
app = Application(
|
|
reddit_monitor,
|
|
webhook_notifier,
|
|
api_conn,
|
|
post_manager,
|
|
post_analytics_manager,
|
|
submission_manager,
|
|
)
|
|
app.run()
|
|
|
|
"""
|
|
TODO:
|
|
- pull upvote ration into analytics?
|
|
- sqlite vs postgres figure out
|
|
- basic front end (react)
|
|
- tests
|
|
- logging
|
|
- Filter out canadian/uk deals
|
|
- track score and number of comments over time in db
|
|
- try to identify product, number of cards, price per card, etc
|
|
- track price over time for each product
|
|
- try to identify platform ie. costco for gift card, tiktok for coupons, etc.
|
|
- support for craigslist, ebay, etc.
|
|
- front end - vizualization, classification, lookup, etc.
|
|
"""
|