Alright... I finally got time to work at this a bit, and I still can't seem to get it right. I've done everything in the correct order (or at least, I believe) and with all of the correct information and I still can't seem to get it working.

Here's what I've done so far (note: this was all done using my bot account first, and THEN my main account just to make sure that wasn't the problem.)
-Registered my application via: twitch.tv/settings/connections
-Got my oauth token
-Downloaded the $json script ( http://www.mircscripts.org/comments.php?cid=4407 )
[side note, wasn't sure what to do with this... maybe that's the problem? I placed it in my mIRC folder though... hopefully that's what I was supposed to do]
-Fixed up the script to fit my information.
-Authorized to run app from my account.



Script I'm using (thanks to Loki)
Code:
alias -l twitch.token {
  if ($1 == My_Bot) return Bot_AccessToken
}

on @*:text:!topic*:#:{
  if ($2 != $null) {
    if ($nick isop #) twitch.topic # $2-
  }
  else {
    twitch.topic #
  }
}

alias twitch.topic {
  var %chan = $1, %topic = $2-
  var %sockname = twitch.topic. $+ $ticks
  hfree -w %sockname | hmake %sockname
  hadd %sockname headerfile %sockname $+ .header.txt
  hadd %sockname datafile %sockname $+ .data.txt
  hadd %sockname params %chan
  hadd %sockname oath.token $twitch.token($mid(%chan,2-))
  hadd %sockname request /kraken/channels/ $+ $mid(%chan,2-)
  if (%topic != $null) {
    hadd %sockname method PUT
    hadd %sockname data channel[status]= $+ $urlencode(%topic)
    hadd %sockname signal topic.set
  }
  else {
    hadd %sockname method GET
    hadd %sockname signal topic.get
  }
  sockopen -e %sockname api.twitch.tv 443
}

on *:signal:topic.get:{
  var %err = $1, %sockname = $2, %header = $3, %data = $4, %chan = $5

  if (* 200 OK iswm $read(%header,1)) msg %chan Status: $json(%data,status)
  else msg %chan Could not get status.

  hfree -w %sockname
  .remove %header | .remove %data
}

on *:signal:topic.set:{
  var %err = $1, %sockname = $2, %header = $3, %data = $4, %chan = $5

  if (* 200 OK iswm $read(%header,1)) msg %chan Status set: $json(%data,status)
  else msg %chan Could not set status.

  hfree -w %sockname
  .remove %header | .remove %data
}

on *:sockopen:twitch.*:{
  var %a = sockwrite -n $sockname
  %a $hget($sockname,method) $hget($sockname,request) HTTP/1.1
  %a Host: api.twitch.tv
  %a Connection: close
  %a Accept: application/vnd.twitchtv.v2+json
  if ($hget($sockname,oath.token) != $null) %a Authorization: OAuth $v1
  if ($hget($sockname,data) != $null) {
    %a Content-Type: application/x-www-form-urlencoded
    %a Content-Length: $len($v1)
  }
  %a $+($crlf,$hget($sockname,data))
}

on *:sockread:twitch.*:{
  var %header
  var %headerfile = $hget($sockname,headerfile)
  var %datafile = $hget($sockname,datafile)

  if (!$hget($sockname,header.complete)) {
    sockread %header
    while (%header != $null) {
      write %headerfile %header
      sockread %header
    }
    if ($sockbr) hadd $sockname header.complete $true
  }
  if ($hget($sockname,header.complete)) {
    sockread &read
    while ($sockbr) {
      bwrite %datafile -1 -1 &read
      sockread &read
    }
  }
}

on *:sockclose:twitch.*:{
  var %header = $hget($sockname,headerfile)
  var %data = $hget($sockname,datafile)
  var %signal = $hget($sockname,signal)
  var %params = $hget($sockname,params)

  if (%signal) .signal %signal 0 $sockname %header %data %params
  else {
    hfree -w $sockname
    .remove %header | .remove %data
  }
}

alias urlencode return $regsubex($1-,/([^A-Z0-9])/gi,$+(%,$base($asc(\1),10,16)))



I feel like I'm probably overlooking the smallest detail someplace and it's making me get the "Can't set status" error message. Again, and as always, ANY help is appreciated. Thank you for the help you've already given me. I just can't figure this out. I've worked at it a bit over the last few days and today I put nearly all my focus onto it. I even tried googling a few things before posting again about it, but alas... Here I am. Sorry, and thanks again.

Last edited by Bramzee; 14/05/14 03:35 AM.