ViralVideos Widget: The Number Ones

I have a huge backlog of half-done posts. I just can’t seem to get here frequently enough. Maybe I should cut out my Daily Show/Colbert Report habit for a month — see if that helps… Anyway.

Over at work, I’ve been tinkering with a little side project with Yaron amidst the gazillion other things I’ve been up to: a rewrite of ViralVideos.com. Yaron designed the site and the first rev was built by a “contractor” for cheap. The code was a tangled mess. It did work pretty well for being the morass of php generating php generating javascript generating javascript generating HTML that it was, but it was totally unmodular and non-reusable (and not indented and commented lightly, in Russian, at that). Anyway. I’ve improved upon that situation (though there is still work to be done. More on that later (with props to Smarty and jQuery).

One nice side effect is that in creating a more sane data model, we could quickly throw together other fun things, like the recently launched ViralVideos #1’s widget (see sidebar of this blog). The widget shows the current “#1″ video on eight top video sites by day/week/month/ever (approximately). It recently went live on the new “all things Internet video” blog recently launched by Om Malik, NewTeeVee. Holy crap!

For the geeks — I originally designed it as a simple javascript include which seemed to work ok, but when embedded in sites with anything but very simple xhtml/css caused unpredictable results. Embedding the whole thing in an iframe is proved much more reliable so this first revision is a simple javaccript-writes-ifram embed. The downside of using an iframe is the little “get this” drop-out box needs the have space to open into (it won’t just push crap out of its way like it would if it was embedded directly in the page) so the frame must be padded, but otherwise it works well. Ad networks frequently use this approach since their ads are usually designed to land in a fixed-sized space.

Next up? Probably a Flash widget for any even fancier interface and the ability to live inside a MySpace profile page…

Leave a Reply