Is there a way to embed twitch on your site so that only the most viewed streamer plays?

I updated my example after talking to someone who does programming and knew PHP.

Increased the speed of finding the streamer on the list with the most viewers by stepping through it once.

Added a fallback, that if none of the original listed streamers are found, find the top twitch streamer and use them instead. (From [quote=“Fugiman, post:4, topic:3309”]
https://api.twitch.tv/kraken/streams?limit=1
[/quote]
)

Added some basic error messages that will give a hint to what went wrong, if anything at all.

I also put in some comments for helping people figure out what’s going on.

The whole example is visible at my example page
-See it in action-
-See the code-