Created
May 13, 2011 06:55
-
-
Save bobpoekert/970101 to your computer and use it in GitHub Desktop.
stream count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twisted.web.client import getPage | |
import json | |
@after(getPage, key=lambda channel: "http://api.justin.tv/api/stream/list.json?channel=%s" % channel) | |
def viewer_count(response, channel): | |
data = json.loads(response) | |
return data[0]['stream_count'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment