Back to all blogs

Showing posts tagged: 'Tumblr'

The Bandwagon

Thursday, April 9, 2009, 02:15am

 

I've always been a late adopter of new, cool stuff and, as a web developer, it's not a good habit to have. For example, I was late in getting into each and every social network including MySpace, Facebook, Twitter, you name it. It's in my nature to avoid the hype I suppose. I decided recently that anything new that I see, I'm going to sign up for it. Or at least seriously consider it. I have to keep in the now, stay hip with the kids, stay open-minded. And for my job, I never know when someone is going to come along and ask if we've done any work with (insert over-hyped new company here)'s API or whatever.

I have two recent adoptions into my repertoire: Posterous and Tumblr. If you're unfamiliar, they're both Tumblelog or Micro-Blogging platforms, A.K.A. blogs for the A.D.D.-impaired, A.K.A. everyone using the internet. Both have some great features and I think the beauty of them (and perhaps the format in general) is the simplicity of it all: simple to imbibe and simple to use.

We've been using Posterous as a blogging platform over at Cuban Council and it's been really great to use. Normally getting everyone to contribute to a company blog would be difficult, but a good chunk of us have been adding regularly, probably due to its ease of use. You don't even need an account to post anything. If your email is added to the list of contributors then you're set. You send an email to post@myaccount.posterous.com (simple to remember) using the subject as a title and the body as the post content, including images and other media attachments that are parsed into a blog post on your Posterous site.

I've also made a personal Tumblr blog and of the two, I think Tumblr really takes the cake. Posting is easy in either one, but with Tumblr you can completely customize your site design using HTML, CSS, Javascript, etc., with a very simple template syntax to display your Tumblr post contents. On Posterous you're stuck with the generic site-wide "sticky note" styling. One of the features of Tumblr that blew me away is that you can post audio to your blog directly from your phone! You set your phone number in your account, along with a pin number, you call the Tumblr number, enter your pin, it records your voice, and blam! It's on your blog! There are only a couple of slight pitfalls in my mind: first, the post email is a random key (e.g. ti7kwn44@tumblr.com) so it's not so easy to remember, and second, there's no built-in commenting system. The latter, however, is remedied by an API with which you can use a plugin to allow commenting.

To continue my bandwagon bonanza, I've finally started off into the world of jQuery! Alright settle down, I know that was huge. I've been a big MooTools guy for the longest time and I haven't purposely avoided jQuery, I just haven't needed to use it (much). Again, with my job I should have a decent grasp on the various Javascript frameworks out there so, with jQuery being the biggest one these days, I finally dove into the tutorials tonight and I'm actually pretty excited about it. I've used jQuery before — or a better way to describe it: stumbled around jQuery before — but looking through the tutorials gave me a good basic understanding that I was missing before and introduced a feature to me that I think is awesome: Live Events! I remember hearing about this feature but I never quite understood it until I put it into practice. I realize I'm aeons behind on this, but if you're interested in Javascript and you don't know what live events are, I'll explain why it's so cool. I've had situations before where I'll load HTML content into a div via AJAX, and I need some Javascript events to apply to some elements in my newly added code. Let's say I want all my links to log their 'href' value into the Firebug console when clicked (MooTools style):

$$('a').addEvent('click', function(e) {
    console.log(this.href);
});

or jQuery style:

$('a').click(function(e) {
    console.log($(this).attr('href'));
});

With MooTools, I would have included some inline Javascript with my loaded HTML, duplicating the code above to take care of it, and turned on the evalScripts option like so:

var oRequest = new Request.HTML({
    update: $('put-html-in-me'),
    url: '/some/url/',
    evalScripts: true
});

Two things suck about this: it's redudant because I'm applying the same events to the same type of objects using two different sets of the same code, and it's using something with the word eval in it, which makes me pee my pants a little. So jQuery live events takes care of this by using whatever selectors you want and applying the events to the all DOM elements as they are added:

$('a').live('click', function(e) {
    console.log($(this).attr('href'));
});

This means that any 'a' tag existing in or added to the DOM is going to log it's 'href' value when clicked. And I can use jQuery's Selectors to apply it to more specific elements if I need it to. Pretty damn sweet.

And that's about all for my nerdy rant tonight. If you're a hip kid and you think there's a bandwagon I need to jump on, let me know. And yes, I already know about Flutter.