Example of the Yahoo Live Api

Yahoo! Live launched recently along with a nice RESTful API. I’ve spoken before about the beauty of REST being in lowering the barrier to hacking and when I wanted a quick feature for Live it was simplicity itself to put together.

A few friends are using it far too much it seems, Ben has 7.6 hours and Si has already clocked up 15 hours. But for the most part I keep missing their no-doubt highly entertaining antics. One thing that Live misses I feel is a favourite users or previously viewed channels list. Basically I want to see which of my friends who use the service are broadcasting right now. Something like:

Yahoo! Live Online

The API request we’re interested in is the /channel/PERMALINK method. This lets us get information about whether the user is broadcasting at the moment.

name; 
  if ($response->broadcast) {
    $status = 'live';
  } else {
    $status = 'offline';
  }
  $statuses["$name"] = $status;
}
function displaylist($array) {
  $output = '';
  if (count($array) >= 0) {
    $output .= '
    '; foreach ($array as $key => $value) { $output .= "
  • "; $output .= ""; $output .= "$key"; $output .= "$value
  • "; } $output .= '
'; } return $output; } echo displaylist($statuses); ?>

I’ll add a few more people to my list when I discover other people using the service. If you have an account leave a comment. I’ve added a touch of javascript as well so as to avoid having to reload the page manually. This way I can loiter on my little aggregator until someone I know starts broadcasting and head over to Live for whatever Si has been spending 15 hours doing.

Comments

  1. The other thing that Live misses is the ability to work through firewalls. :(

    Matthew Pennell - 13th February 2008

  2. Oh, and if it’s throwing errors it’s probably because Yahoo! live is in maintenance and I didn’t build in any error checking as yet :-)

    gareth - 13th February 2008

  3. 15 hours of pure, unadulterated screen staring. It’s marvellous what you can broadcast from an office!

    Si Jobling - 13th February 2008

  4. Oh cool! I’d been wondering if it was possible to check if someone was online or not only yesterday, and there’s the code for it. Thanks :)

    Matt Wilcox - 13th February 2008

  5. Yeah, I could have explained a little better actually. You can check whether someone is online by checking for the presence of the broadcast element in the response from /channel/PERMALINK

    gareth - 13th February 2008

  6. [...] anyone to create their own live video channel, available to anyone who cares to watch. As has been pointed out before, there is plenty of scope to increase its potential for social networking. YLiveGroups is our [...]

    YLiveGroups: Live Video at BarcampBrighton2 : Dharmafly - 15th March 2008

  7. [...] servers. Generally speaking, it’s been quite well received. Not only have they opened up the API for developers to mess around with, but there has also been quite a large following in the DJ community with many DJ’s [...]

    Miami Winter Music Conference on Yahoo! Live | Simon Jobling (aka One Phat DJ) - 19th March 2008

Comments are now closed.