diff --git a/README.md b/README.md index 13c340a..62cdd5b 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,36 @@ An easy to use Python bot for retrieving Twitch chat data from multiple streams simultaneously. +Steps for acquiring credentials: +1) Get a twitch.tv account + - get one here https://www.twitch.tv/signup +2) Obtain a Twitch client id + - Get yours by registering an app here https://dev.twitch.tv/console/apps/create + - (You can set 'OAuth Redirect URL' to 'http://localhost') +3) Acquire a Twitch OAuth token + - Get yours here https://twitchapps.com/tmi/ -__Current functionality__: -- Connect and log the chat data from multiple Twitch streams -- Logging of chat data terminated if the channel goes offline +Store these values securely. You now have everything you need to use TwitchListener. +Example usage: -__Planned functionality__: -- Parsing the stored logs into usable formats (.CSV etc) -- Specify duration of data collection +```python +import TwitchListener -__Example usage:__ +# Connect to Twitch +bot = TwitchListener.twitch('yourUsernameHere', + 'yourOauthHere', + 'yourClientIDHere') -import TwitchListener +# List of channels to connect to +channels_to_listen_to = ['Northernlion', 'DumbDog', 'DanGheesling'] + +# Scrape chat data into raw log files. (Duration is seconds) +bot.listen(channels_to_listen_to, duration = 1800) -# Set up twitch connection -bot = TwitchListener.twitch( nickname = 'yourUsernameHere', oauth = 'yourOauthTokenGoesHere', client_id = 'yourClientIDGoesHere' ) +# Convert log files into .CSV format +bot.parse_logs(timestamp = True) +``` -# Scrape chat data. -bot.listen(channels = ['Northernlion', 'Ninja'], duration = 10 ) -# Convert the text log files to csv -bot.parse_logs()