JavaScript + PHP + MySQL – determine if user is online or logged in

This is a pretty common task that doesn’t have a perfect answer. It’s not possible to determine if a user disconnects, leaves the page, closes the browser, etc (besides window unload methods, which aren’t practical for this use case). So we fake it as best we can. Here’s how I do it. 1. Create a […]

Cache “nudger”

With web technologies generally, and flash specifically, managing cached assets can sometimes feel like walking a tightrope. If you’ve got a simple slideshow and have occasional updates to the image you want immediately reflected to the client, you’ll often see traditional “cache-busting” methods like appending a random number of the current UTC time to the […]

JavaScript (jQuery + MooTools) get WordPress Posts from RSS as JSON

The url is structured like so:[encoded URL of RSS feed] Replace [encoded URL of RSS feed] with the URL of the WP blog you want to fetch posts from. I’ll use mine ( for the samples. With either method, you’ll get back an object with the following keys: responseData responseDetails responseStatus responseData has a […]

JavaScript (jQuery + MooTools) get tweets from twitter feed

The url is structured like so:[twitter handle].json Replace [twitter handle] with the user whose tweets you’re requesting. I’ll use mine for the samples. With either method, you’ll get back an indexed array of objects (so the most recent tweet would be data[0]). Each object has the following keys: in_reply_to_user_id in_reply_to_user_id_str contributors in_reply_to_status_id created_at user […]