bmn: You can remove the stream URL I sent you cause I deleted that account. When I get the new show on my new account up and ready, I'll send you the new details.
Indeed it will. This new lib is much better programmed, even if something does go wrong it should be hella easier to debug.
Speaking of debug, I finally found a solution to my problems with handling notices and errors gracefully. I wanted to be able to see what was going on in detail without having to go digging through the backend - particularly when it comes to channels on Ustream disappearing. Ustream's API offers no margin for error, so in that case a single 10-channel request has to fall back to ten 1-channel requests, resulting in 11 requests on top of the rest. Every 30 seconds.
The main problem with debug was basically in allowing different types of functions and user code to use the exception system for logging, while not writing to something like a global variable that might already be in use from someone else's code. sda_stream being a library - something that doesn't do anything on its own, that a developer can take and use in their own programs - and w00ty just being an app that uses it, the lib has to step on as few toes as it can, which was where I was having problems.
Part of the reason the original sda_stream was a bit of a mess, was that it was designed as a Javascript lib first, and a PHP lib second. The idea behind it was the the JS lib could go out and send the requests to Ustream's API and do all that cool stuff on its own, and it had an added option to use the PHP lib for caching purposes. In fact, PHP only came in in v0.4, with v0.6 being the last version I released. Problem with that was Ustream's data structure is p weird, and allowing JS to do everything meant I had to make the PHP output look similar, limiting what I could do with PHP.
The caching has of course turned out to be really important, what with there being so many channels and an increasing number of visitors, so I don't really think a JS lib is now worth it. Instead I'd rather let people do all the JS side the way they want to do it, and have the PHP lib do all the API work.
Ok rambling over. Really now all I need to do is the new auto-updating, which should be fairly easy, and perhaps a way of sending error messages through the updates.
Okey, so the new version is finally up. My apologies to anyone that got somewhat short PM replies - I had pretty much a full page of PMs to reply to.
Quick rundown of the changes:
Justin.tv channels can be added - if you're one of those switching over, let me know where your new channel is.
The latest SDA update is shown at the top - this does not auto-update.
Any errors and warnings reported in getting auto-updates are shown in the expanding debug area at the bottom... this is more useful for me than anything else.
A new Ajax-JSON implementation that deals with timeouts properly - should stop auto-updates from freezing if you lose your Internet connection.
Another set of updates. This one doesn't break the page if you loaded it before the update, so I recommend refreshing if that's the case. The most noticeable updates:
* Improve update speeds by avoiding PHP entirely whenever possible. * New "online <-> offline" page change code that maintains alphabetical order in the "lazy bums" section.
Updates. Only noticeable one is that Justin embeds should now always be 320x260. Previously, AJAX updates taken directly from the JSON cache file resulted in embeds at Justin's default (bigger) dimensions.
You probably noticed recently that the auto-update frequently failed (shown by the debug area turning red). I haven't been able to find the true cause, but it's been fixed by going back to using PHP for every load instead of trying to use the cache file directly. It'll be slightly slower, but at least it works.