7 Ways Twitter is Like Cigarette Smoking

1. People who have never tried it don’t get it.
As far as I can tell, the naysayers have never tried Twitter. I’ve seen people complain about Twitter on Facebook, but a Facebook status update and a tweet are nearly the same: short snippets of information that you want to share.

The at-signs (@) and hashes (#) that have become ubiquitous on Twitter may be part of the problem. Although I feel that if you can decipher an emoticon you ought to be able to handle @replies and #hashtags.

The difference?
A tweet is public if your Twitter timeline is public. (A timeline is akin to your wall on Facebook.) This is probably one reason why marketers love it: they get to push links out to the world, including search engines, whereas on Facebook you actually have to work to build an audience. (More on Facebook later.)

2. It’s addictive.
Clearly, it can be. Maybe not to the same extent as nicotine, but some people can’t stay off Twitter. People complain about how many breaks smokers take. Sick of your friends leaving you alone at a party while they compose a tweet? Annoyed that they ignore you to check the latest on their Blackberries? Tired of your co-workers taking tweet breaks? Which leads to…

3. It interrupts you.
Cravings for cigarettes driving you to distraction? Twitter can drive you insane. I quickly disabled updates on my phone, because I would have exceeded my 400 monthly SMS messages in the span of a few days. I installed twhirl, and later TweetDeck, and found that I was getting notifications almost every minute. That’s no way to work. I changed my TweetDeck settings to check for updates every 40 minutes. I may find out about the latest celebrity death 10 minutes after you do, but I still have some semblance of mental focus.

4. Users love to talk about it
Smokers love to talk about smoking. What brand you smoke, the way you hold your cigarettes, whether or not you prefer hard-packs or soft-packs, whether or not you pack your cigarettes before you open them–these are the sorts of conversations people have on their smoke breaks. My friend Brady cited all the unnecessary talking about smoking as a top reason to quit smoking.

Twitterers love to talk about Twitter. People are in love with Twitter right now, and they aren’t afraid to shout it from the rooftops. Which apps they use, who they follow, how it can turn their struggling companies into a giants. Even I am guilty of this: about a quarter of my tweets reference Twitter. I imagine this may fade over time, along with the accompanying backlash. After all, remember blowthedotoutyourass.com?

5. You do it more when you’re drinking.
…and that’s not a good thing.

6. Short and unsatisfying.
Oscar Wilde wrote, “A cigarette is the perfect type of a perfect pleasure. It is exquisite, and it leaves one unsatisfied.” I’ve seen people pack a lot of info into a mere 140 characters, but sometimes 140 characters just isn’t enough. That is why more than half of the tweets I am perusing right now contain shortened links from sites like bit.ly, short.to, ff.im, and tr.im.

[I actually really dislike shortened links, because they remove a critical piece of info–the destination URL–from the link. If someone posts a link with little-to-no explanation, I will not click on it for two reasons: one, there’s no incentive, two, it could be spam or lead to a malicious web site.]

7. It’s bad for your health.
OK, I admit it: that’s a weak link. Just don’t tweet while driving, OK? But just as smokers often pass on exercise, Twitter may cause people or companies to scrimp on more important things, like phone calls, face-to-face conversations, making good products, or even updating Facebook. Time spent on Twitter is time not spent on something else.

(That’s right, I said Facebook. As I mentioned to a friend recently, if Facebook stepped on Twitter, Facebook would hardly notice. Check out Facebook vs. Twitter on Compete.com. To which should you devote more time?)

Afterthoughts
I should note that I have been tobacco-free for years and would never advocate tobacco use. On the other hand, I think with some caveats, Twitter can be fun, useful, and relatively harmless.

I decided to capitalize Twitter in this post because it is a proper noun. I’ll respect bell hooks’ preference for lowercasing, but that’s where I decided to draw the line this time; I reserve the right to be inconsistent.

Additions?
Feel free to contribute your own comparisons in the comments!

Javascript insertAfter()

There is no Node.insertAfter() DOM function in Javascript, but it is clearly something that developers would like.

As the Gecko DOM Reference for Node.insertBefore() points out, this can easily be achieved with
parentDiv.insertBefore(nodeToInsert, nodeToInsertAfter.nextSibling);

If nodeToInsertAfter doesn’t have a next sibling, a NULL value will be returned and nodeToInsert will be inserted as the last child of parentDiv.

If you find it frustrating to type insertBefore when you want to insertAfter, that’s OK: you can add that function to the Object object:
Object.prototype.insertAfter = function (newNode) { this.parentNode.insertBefore(newNode, this.nextSibling); }

Now you can type:
nodeToInsertAfter.insertAfter(nodeToInsert)

Using Perl and PDF::API2 to Update PDF Properties and Metadata

What do you do when you have 600 PDF documents with titles in all caps, when you need the titles to be title-cased? I dreaded the thought of asking anyone to open each document and edit the titles by hand, not to mention fearing the typos that process might introduce.

For better or worse, here was my solution:

Sounds fast and easy, right? Well, there were a few hitches:
Continue reading Using Perl and PDF::API2 to Update PDF Properties and Metadata

Twitter Status IDs and Direct Message IDs

twitter-birdI recently created a Magic Eight Ball twitter-bot as a demo. Written in Python using the python-twitter API wrapper, it runs every 2 minutes and polls twitter for new replies (status updates containing @osric8ball) and direct messages (DMs) to osric8ball. If there are any, it replies with a random 8-Ball response.

Every status update and DM has an associated numeric ID. Initially, I stored the highest ID in a log file and used that when I polled twitter (i.e. “retrieve all replies and DMs with ID > highest ID”). However, I discovered that status updates and DMs apparently are stored in separate tables on twitter’s backend, as they have a separate set of IDs. Since the highest status ID was an order of magnitude larger than the highest DM ID, my bot completely ignored all DMs. This was not entirely obvious at first, as the IDs looked very similar, other than an extra digit: 2950029179 and 273876291.

My fix for this was to store both the highest status update ID and the highest DM ID is separate log files.

Another interesting twist: you have to be a follower of a user in order to send that user a DM. Continue reading Twitter Status IDs and Direct Message IDs

University of Michigan jobs site has major browser compatibility issues

At the risk of sounding like a one-note, I would like to again talk about browser compatibility issues. These compatibility issues affect an organization’s bottom line, and should not be ignored. In this particular case, The University of Michigan’s (U-M) job web site is unusable to about 10-15% of visitors, by my estimates (they are using Google Analytics on the page, so they should have that data). To me, this says that U-M may be missing out on some of the most qualified candidates for their position openings, undeniably at great cost to the organization. [I am particularly concerned in this case because U-M is my alma mater.]

In particular, the browsers that are not compatible with the U-M jobs site are Safari, Chrome, and Opera — browsers typically used by more tech-savvy users — so U-M may be missing out on the very candidates best-suited for work in today’s web-based world.
Continue reading University of Michigan jobs site has major browser compatibility issues

T-Mobile Website Unfriendly to Chrome, Safari

Early this morning, Nicola was bugging me to add a data plan to her phone account in anticipation of receiving her shiny new MyTouch. We logged on to the site using our favored browser, Google’s Chrome. Here’s what we found:

T-Mobile\'s default page in Chrome, post login
T-Mobile's default page in Chrome, post login

After several unsuccessful attempts to view info for her line from several different screens, we called T-Mobile’s customer support. The service rep walked through the same steps and said, “OK, now you should see tabs on the left with your names, phone numbers, and ‘Add A Line’.”

That’s when it hit me. I should try a different browser.
Continue reading T-Mobile Website Unfriendly to Chrome, Safari

Apache Install and Ambiguous Errors

I installed Apache 2.2.11 on the Windows XP portion of my desktop workstation for development purposes, but I got a lot of ambiguous errors when starting from the Apache Service Monitor or the Windows start menu.

Finally, when I started Apache from the command line I got a more informative error:
(OS 10048) Only one usage of each socket address (protocal/network address/port) is normally permitted. : make_sock: could not bind to address 127.0.0.1:80 no listening sockets available, shutting down

It turns out, I had Skype running, which by default binds to ports 5520, 80, and 443. There are several solutions:
Continue reading Apache Install and Ambiguous Errors

Validating the Referer: Not as Useless as I Thought?

I used to validate the HTTP referer header to verify that users were accessing certain pages from certain other pages. For example, users accessing sampleapp/edit.cfm should be getting there from sampleapp/index.cfm. Anyone accessing sampleapp/edit.cfm without coming from sampleapp/index.cfm was probably monkeying around and should be send back to the index page, or possibly even logged out.

However, it is fairly trivial to modify your referer header, so anyone who wants to monkey around with sampleapp/edit.cfm can make it look like they are coming from sampleapp/index.cfm. (If you’re interested in modifying your HTTP headers, I suggest checking out the Tamper Data Firefox plugin.) The check provides absolutely no assurance that the user is really coming from the page. Therefore, I decided the check was useless.

I’ve been attending a weekly web application security study group with some of my colleagues for the past several weeks, where we’ve been reading and discussing The Web Application Hacker’s Handbook. The past couple sessions have been about cross-site scripting (XSS). Justin Klein Keane brought up a good point at today’s session: checking the referer may not keep a malicious user from altering his or her referer string, but could help identify victims of XSS attacks who were possibly directed to submit malicious data from a third-party site.

Checking the referer isn’t a sufficient protection against malicious users, by any means, but it could still be helpful. What do you think?

Installing Adobe AIR and Tweetdeck on an Asus eee 701

Tweetdeck is an Adobe AIR application that is a twitter client, and recently also a Facebook client.

My attempts to install Adobe AIR on the Asus eee 701 (running the default Xandros distro) were foiled several times in spite of following the instructions:

  1. Download Adobe AIR
  2. Make the AdobeAIRInstaller.bin file executable
  3. Run the .bin file as a superuser

I got a nice friendly fail message from the Adobe AIR installer every time.

I found a few relevant forum posts, e.g. Adobe Air Linux won’t install on Eee PC, that suggested memory was an issue. Sure enough, running in Full Desktop Mode with 1440×900 screen resolution (on an external display), I only had about 90MB of 500MB free.

I restarted the eee in Easy Mode and then immediately ran AdobeAirInstaller.bin. Success! (I later found these same instructions on the eee user forums.)

Installing Tweetdeck was trivial at that point: download the .air file, find it in the File Manager, and double-click it. However, when I ran it, it didn’t do anything. At one point I got a message that I was running an unknown desktop, and that Tweetdeck required Gnome or KDE.

I restarted in Full Desktop Mode, and was surprised to find a Tweetdeck icon already on the desktop. I ran it and was prompted to use KWallet, a KDE password manager. I canceled out of that, and found that Tweetdeck opened, but still didn’t do anything.

I tried again, activated the KWallet password manager, and then it worked! Tweetdeck prompted me for my twitter login, I additionally logged in to Facebook, and now I have a mean, lean, social networking machine.

Embedded FLV video players: Flowplayer and JW Player

Over the past several months, I have worked with both Flowplayer and JW Player as embedded FLV video players.

Why wouldn’t you just upload your videos to YouTube and use their embedded player? That’s a pretty fair question, as I think YouTube provides:

  • An excellent player that your users are already familiar with
  • A variety of options to control the appearance (e.g. you can disable related videos)
  • High-availability bandwidth

Of course there are several drawbacks:

  • Limits on length and file size
  • Critical infrastructure is no longer in your control
  • Their logo appears on your site
  • Progressive download only (no streaming)

Let’s take a look at both Flowplayer and JW Player:
Continue reading Embedded FLV video players: Flowplayer and JW Player