I’ve been trying to use the undocumented hosts API at http://tmi.twitch.tv/hosts?include_logins=1&target=[user id] but it needs JSONP compatibility with the callback parameter. Or at least, I can’t seem to get it to work.
I’m using javascript and only javascript at the moment, no php.