Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #from layer7_utilities import Logger
- class BaseOAuth(object):
- def __init__(self, __description__, __version__, __author__):
- self.USR_AGNT = __description__ + " v" + __version__ + " by " + __author__
- # Initialize the logger
- #self.logger = Logger('Countdown', __version__)
- #self.logger.debug('Initialized the BaseOAuth')
- def login(self):
- import praw
- r = praw.Reddit(user_agent=self.USR_AGNT,
- client_id=self.APP_ID,
- client_secret=self.APP_SECRET,
- username=self.UNAME,
- password=self.PASSWD)
- #self.logger.debug('{} | Created the Login'.format(r.user.me()))
- return r
- def set_info(self, id, secret, username, password):
- self.APP_ID, self.APP_SECRET, self.UNAME, self.PASSWD = id, secret, username, password
- #self.logger.debug('Set the login info')
- class oAuth(object):
- def __init__(self, id, __description__, __version__, __author__):
- self.usernames = [ # Sample. This should be replaced with strings with the actual information in them, _in this order_.
- # You may use as many accounts as you like.
- (app_id, app_secret, username, password),
- (app_id2, app_secret2, username2, password2)]
- #self.logger = Logger('Countdown', __version__)
- self.accounts = []
- for i in self.usernames:
- x = BaseOAuth(__description__, __version__, __author__)
- x.set_info(*i)
- self.accounts.append(x)
- #self.logger.debug('Retrieved the logins from the database')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement