Skip to content

Instantly share code, notes, and snippets.

@steve-ayerhart
Created October 12, 2015 14:18
Show Gist options
  • Save steve-ayerhart/ec785eab218dc14e112b to your computer and use it in GitHub Desktop.
Save steve-ayerhart/ec785eab218dc14e112b to your computer and use it in GitHub Desktop.
(require 'cl)
(request
"https://api.twitch.tv/kraken/streams"
:params '(("game" . "StarCraft II") ("limit" . "10"))
:parser 'json-read
:success (function*
(lambda (&key data &allow-other-keys)
(when data
(with-current-buffer (get-buffer-create "*Sc2 Streamers*")
(erase-buffer)
(insert (mapconcat (lambda (stream)
(let* ((channel (assoc-default 'channel stream))
(name (assoc-default 'name channel)))
(format "%s" name)))
(assoc-default 'streams data)
"\n")))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment