def __init__(self): self.config = Config() from redditrepostsleuth.core.services.duplicateimageservice import DuplicateImageService self.uowm = SqlAlchemyUnitOfWorkManager(get_db_engine(self.config)) self.notification_svc = NotificationService(self.config) self.event_logger = EventLogging() self.reddit = get_reddit_instance(self.config) self.dup_service = DuplicateImageService(self.uowm, self.event_logger, self.reddit)
def __init__(self): self.config = Config() self.reddit = RedditManager(get_reddit_instance(self.config)) self.uowm = SqlAlchemyUnitOfWorkManager(get_db_engine(self.config)) self.event_logger = EventLogging(config=self.config) self.response_handler = ResponseHandler( self.reddit, self.uowm, self.event_logger, live_response=self.config.live_responses)
def __init__(self): self.config = Config() self.reddit = RedditManager(get_reddit_instance(self.config)) self.uowm = SqlAlchemyUnitOfWorkManager(get_db_engine(self.config)) self.event_logger = EventLogging(config=self.config) self.response_handler = ResponseHandler( self.reddit, self.uowm, self.event_logger, live_response=self.config.live_responses) self.notification_svc = NotificationService(self.config) self.config_updater = SubredditConfigUpdater( self.uowm, self.reddit.reddit, self.response_handler, self.config, notification_svc=self.notification_svc)
from redditrepostsleuth.core.services.reddit_manager import RedditManager from redditrepostsleuth.core.services.response_handler import ResponseHandler from redditrepostsleuth.core.db.db_utils import get_db_engine from redditrepostsleuth.core.db.uow.sqlalchemyunitofworkmanager import SqlAlchemyUnitOfWorkManager from redditrepostsleuth.core.services.responsebuilder import ResponseBuilder from redditrepostsleuth.core.util.helpers import get_reddit_instance, get_redis_client from redditrepostsleuth.core.services.duplicateimageservice import DuplicateImageService from redditrepostsleuth.submonitorsvc.submonitor import SubMonitor if __name__ == '__main__': config = Config() event_logger = EventLogging(config=config) uowm = SqlAlchemyUnitOfWorkManager(get_db_engine(config)) response_builder = ResponseBuilder(uowm) reddit = get_reddit_instance(config) reddit_manager = RedditManager(reddit) dup = DuplicateImageService(uowm, event_logger, reddit, config=config) monitor = SubMonitor(dup, uowm, reddit_manager, response_builder, ResponseHandler(reddit_manager, uowm, event_logger, source='submonitor', live_response=config.live_responses), event_logger=event_logger, config=config) redis = get_redis_client(config) while True:
def __init__(self): super().__init__() self.notification_svc = NotificationService(self.config) self.link_blacklist = [ ] # Temp fix. People were spamming onlyfans links 10s of thousands of times self.reddit = get_reddit_instance(self.config)
from redditrepostsleuth.core.config import Config from redditrepostsleuth.core.services.eventlogging import EventLogging from redditrepostsleuth.core.services.reddit_manager import RedditManager from redditrepostsleuth.core.services.response_handler import ResponseHandler from redditrepostsleuth.core.db.db_utils import get_db_engine from redditrepostsleuth.core.db.uow.sqlalchemyunitofworkmanager import SqlAlchemyUnitOfWorkManager from redditrepostsleuth.core.services.responsebuilder import ResponseBuilder from redditrepostsleuth.core.util.helpers import get_reddit_instance from redditrepostsleuth.core.services.duplicateimageservice import DuplicateImageService from redditrepostsleuth.submonitorsvc.submonitor import SubMonitor if __name__ == '__main__': config = Config() event_logger = EventLogging(config=config) uowm = SqlAlchemyUnitOfWorkManager(get_db_engine(config)) response_builder = ResponseBuilder(uowm) dup = DuplicateImageService(uowm, event_logger, config=config) reddit_manager = RedditManager(get_reddit_instance(config)) monitor = SubMonitor(dup, uowm, reddit_manager, response_builder, ResponseHandler(reddit_manager, uowm, event_logger, source='submonitor', live_response=config.live_responses), event_logger=event_logger, config=config) monitor.run()
import threading # TODO - Mega hackery, figure this out. import sys from time import sleep sys.path.append('./') from redditrepostsleuth.core.config import Config from redditrepostsleuth.core.db.db_utils import get_db_engine from redditrepostsleuth.core.db.uow.sqlalchemyunitofworkmanager import SqlAlchemyUnitOfWorkManager from redditrepostsleuth.core.logging import log from redditrepostsleuth.core.util.helpers import get_reddit_instance from redditrepostsleuth.ingestsvc.postingestor import PostIngestor if __name__ == '__main__': log.info('Starting post ingestor') print('Starting post ingestor') config = Config() uowm = SqlAlchemyUnitOfWorkManager(get_db_engine(config)) ingestor = PostIngestor(get_reddit_instance(config), uowm, config) threading.Thread(target=ingestor.ingest_without_stream, name='praw_ingest').start() threading.Thread(target=ingestor.ingest_pushshift, name='pushshift_ingest').start() while True: sleep(10)