![twitch logs twitch logs](https://themarketmail.com/wp-content/uploads/2021/03/cover-768x768.jpg)
Gets the 100 channels with the most current viewers.
#Twitch logs update
# Update the list of channels we're currently in. # Compares the stream lists to find which streams to join/leave.Ĭhannels_to_leave = list(set(old_channels) - set(new_channels))Ĭhannels_to_join = list(set(new_channels) - set(old_channels)) Compares the lists to get which streams haveĮntered/left the top 100. Streams from _get_top_streamers() and compares it with our current Self.sock_nd('PASS \n'.format(channel).encode('utf-8')) Self.sock_nnect((self._server, self._port)) Self.channel_list = self._get_top_streamers()Ĭonnect to the IRC server and then JOIN each IRC channel in self.channel_list Self._server = '' # Twitch IRC IP Address :param limit: The maximum numbers of streams to join. :param refresh_interval: How often (in seconds) to call _update() and get a new list of top streams. :param game: The game that you want all streams to be playing. :param client_id: The client_id of your Twitch dev. :param token: The OAuth token used to join the Twitch IRC. Name as a popular streamer, it will break the script. :param username: What the bot will call itself when joining the IRC server. The number of streams to logĭef _init_(self, username, token, client_id, game='', refresh_interval=60, limit=25): The channels it joinsĪre from a list of the streams with the most current viewers Handlers=[(logs_folder + 'chat.log', # Active log nameĪ bot which joins multiple Twitch IRC channels and records Log files will rotated saved every 10 minutes.
![twitch logs twitch logs](https://goandstream.com/wp-content/uploads/2020/11/Blog-Posts-1-min.png)
Logs_folder = os.path.join(os.getcwd(), 'logs/') Logging.getLogger("requests").setLevel(logging.WARNING) Logging.getLogger("urllib3").setLevel(logging.WARNING) Do you believe it's critical to adhere to the line length, I was seeing mixed opinions of 'yes absolutely' and 'no just make sure it's consistent and readable'? It should be completely PEP8 complaint aside from the line lengths.
![twitch logs twitch logs](https://i.imgur.com/ua7EF6ql.png)
It's a 'bot' which connects to the IRC, retrieves a list of the top streamers from the Twitch API, joins their chat channel, and logs the messages sent by users. I plan to use my Github repo(s) as a demonstration of my skills and knowledge. Specifically I'm looking to improve my skills and make myself a more attractive prospective employee. I am looking to get some feedback on Python 3.6+ project.