What exactly are you trying to do. No offense but your code is a bit all over the place.
; //echo -a $Twitch_Streaming_Game( <twitch_user> )
; Returns the game the specified user is streaming or $false
alias Twitch_Streaming_Game {
; Create some local variables
var %r, %j = Twitch_Streaming_Game
; Retrieve JSON from twitch
JSONOpen -u %j https://api.twitch.tv/kraken/streams/ $+ $1
; Check that there's no errors, and that data.stream.channel.game has a value
if (!%JSONError && $json(%j, stream, channel, game)) {
; save the data in a return variable
%r = $v1
}
; immediately close the JSON handler
JSONClose %j
; return the result, if there isn't one, return $false
return $iif(%r, $v1, $false)
}
Thank you for this post it has helped a lot. I just have a quick question. I would like to have an output from this ONLY if the result comes back $false. I'm guess its as simple as an "if" statement but Im new to coding, and am not sure what the parameters would be. (if you would even use an if statement) Thank you for your time!
A few questions:
Are you using an OS other than windows? If not then this won't work as it uses native libraries to windows.
Could you produce an example that illustrates the failure?
For the record, it does work with SSL, as I just helped @^WeSt use it for twitter searching