Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from . import tabun_api as t_api
- from . import bunker_api as b_api
- from . import utils
- class Api():
- def __init__(self, config):
- self.config = config
- self._login()
- def _login(self):
- if self.config.site == 'tabun':
- self.User = t_api.User(login=self.config.login, passwd=self.config.password)
- print(self.User)
- elif self.config.site == 'bunker':
- self.User = b_api.User(login=self.config.login, password=self.config.password)
- print(self.User)
- def get_stream(self):
- if self.config.site == 'tabun':
- s = self.User.get_comments("/comments/")
- return utils.transform_comments_list(s, 'tabun')
- elif self.config.site == 'bunker':
- s = self.User.get_stream(comments='full')
- return utils.transform_comments_list(s, 'bunker')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement