Giter VIP home page Giter VIP logo

twitch-4's Introduction

twitch

I created this because I wanted to learn how it worked, I realize there are easier options for getting your oauth token.

In order to get an access_token to connect to Twitch follow these steps.

Step 1

Note: I do not recommend performing these steps in Firefox because the client secret does not show up when I try it.

Login to the Twitch account you wish to use
Go to Settings >> Connections
At the bottom of the settings page click 'Register your application'
Enter any name for your application and then http://yourwebsite.com/oauth.php for the redirect URI, click register
Note the client id and client secret for use in step 2.

Step 2

Edit oauth.php and enter the client id and client secret from Step 1
$client_id = "Your twitch client id";
$client_secret = "Your twitch client secret";
$redirect_uri = "http://www.yourwebsite.com/oauth.php";

Upload oauth.php to your website.

Step 3

in the link below replace the client_id and redirect_uri parameters with the values found earlier.

https://api.twitch.tv/kraken/oauth2/authorize?response_type=code&client_id=client_id&redirect_uri=redirect_uri&scope=chat_login&state=whatever

Copy and paste the link into any browser.

If you did everything properly, Twitch should come up and ask you to authorize your own App to use your Twitch account.

After you authorize your own app to use your twitch account the script you uploaded to your server should simply say:

Your oauth token is: [random string starting with oauth:]

If this doesn't work check your settings and then visit the Twitch auth URL above to try again.

How is this useful?

Now you can connect to your channel with any standard IRC client (Such as MIRC) or use most standard IRC bots such as eggdrop to manange your channel.

Test!

C:\Users\tutorial>telnet irc.twitch.tv 6667
PASS
NICK zerocarbthirty
:tmi.twitch.tv 001 zerocarbthirty :Welcome, GLHF!
:tmi.twitch.tv 002 zerocarbthirty :Your host is tmi.twitch.tv
:tmi.twitch.tv 003 zerocarbthirty :This server is rather new
:tmi.twitch.tv 004 zerocarbthirty :-
:tmi.twitch.tv 375 zerocarbthirty :-
:tmi.twitch.tv 372 zerocarbthirty :You are in a maze of twisty passages, all alike.
:tmi.twitch.tv 376 zerocarbthirty :>
quit

Eureka!

If anyone has any trouble get me @zerocarbthirty on Twitter

twitch-4's People

Contributors

zerocarbthirty avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.