mIRC Home    About    Download    Register    News    Help

Print Thread
#262665 09/03/18 01:08 PM
Joined: Mar 2018
Posts: 9
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Mar 2018
Posts: 9
Hello. I used to use some script to show nicks of people as they are on Twitch, instead of lowercase nick.

Code:
alias twitchname {
  if ($hget(nickformat) == $null) { hmake nickformat }
  if ($hget(nickformat,$1)) { return $iif($hget(nickformat,$1) == $null,$1,$hget(nickformat,$1)) }
  var %json https://api.twitch.tv/kraken/users/ $+ $1
  JSONOpen -ud nicename %json
  hadd nickformat $1 $json(nicename,display_name)
  return $iif($hget(nickformat,$1) == $null,$1,$hget(nickformat,$1))
}


I don't remember if this was using some additional thing, but if it did, I had this, cause I didn't change anything past few years. I have all scripts I had back then.

The problem is, it doesn't work anymore. I tried to go to https://api.twitch.tv/kraken/users/ page, but it seems "broken". At least doesn't show any user. No matter if I change users to user and what nick I wote, it just tells me either that not found or bad request. So there is a problem probably.

So what can I do to make the cript working again? Google doesn't say anything.

Thanks in advance.

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
You probably just need to supply a Client-ID. Twitch changed things sometime ago where you need to supply one now.

Example:

Code:
alias twitchname {
  if ($hget(nickformat) == $null) { hmake nickformat }
  if ($hget(nickformat,$1)) { return $iif($hget(nickformat,$1) == $null,$1,$hget(nickformat,$1)) }
  var %json https://api.twitch.tv/kraken/users/ $+ $1
  JSONOpen -uw nicename %json
  JSONHttpHeader nicename Client-ID YOUR_CLIENT_ID_HERE
  JSONHttpFetch nicename
  hadd nickformat $1 $json(nicename,display_name)
  JSONClose nicename
  return $iif($hget(nickformat,$1) == $null,$1,$hget(nickformat,$1))
}

Last edited by Blas; 13/03/18 07:13 PM.
Joined: Mar 2018
Posts: 9
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Mar 2018
Posts: 9
I don't get it. I mean, I know what You mean by registering but... how to do that. The blog You send me says I have to go to connections and at the bottom is the option to do it but... there isn't any? There is the link that dev API has been redirected. I have to go to dev.twitch.tv? Or what? Don't get the instructions that are not really the same as the reality...

And I have to have partnership to do that or sth? Pay for the thing or whatever?

I'm super newbie, so I really need the help ^^;

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
It's been a long time since I've registered an app there. It looks like they changed the process a bit. You're supposed to use your own Client-ID but I mean there's a lot of "public" ones that you find online. I have a bunch of scripts on my GitHub that use my own Client-ID so it's not like it's anything super secret. Feel free to use it if you can't figure out how to register an app: avm4vi7zv0xpjkpi3d4x0qzk8xbrdw8

Joined: Mar 2018
Posts: 9
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Mar 2018
Posts: 9
So I made an app by this tool. But what exactly should I put in OAuth Redirect URI? If I want the Twitch account bot, what should I write?


Link Copied to Clipboard