Farcrada commented on a Page, JSON for MIRC  -  Sep 12, 2014

So, uhm... I've been trying this and tried connecting to somewhere, but it seems that it fails on a SSL call...

I can't seem to get anything to return and there's no errors. The code is, well, good... But it's not returning anything.

Any chance Https/SSL requests are not working?

SReject  -  Sep 13, 2014

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

ProIcons  -  Sep 13, 2014

Does it work on a Non Secure Site?

Farcrada  -  Sep 14, 2014
SReject  -  Sep 14, 2014

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)
Farcrada  -  Sep 14, 2014


bib_lecry  -  Feb 27, 2015

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!

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.