Things You Shouldn't Do (Vol. 3)
Posted by: kmikeym | From: February 14, 2007
Cory Webb is back with a special tool that could just save your life in this special edition of Things You Shouldn't Do: Getting Drunk And Falling Asleep In Bars:
drinking_buddy 1.0 was a perl cgi script that I wrote years ago that would estimate your blood alcohol content (BAC) based on how many drinks you had in a given time. It was extremely crude, you entered a number of drinks (increasing your BAC by 0.02 for each drink), and the number of hours it took you to consume said alcohol (there weren't even any minutes). But alas, this was in a time before free WiFi spots were available at just about every pub.
drinking_buddy 2.0 was a Palm Pilot basic script that was a little more sophisticated. You could pick different beverages (glass of wine, shot, beer, mixed drink) but each one just raised your BAC by 0.02 anyway, so I don't even know why there were options. It also took into account your gender, as men tend to metabolize alcohol slightly faster than women. drinking_buddy 2.0 would also factor your weight into the equation, and would round the total time to 15 minute intervals. The algorithm was so sloppy it was embarrassing.
Since HotSpots still weren't an option, and I always carried my Palm pilot (sharing the app with whoever I met at the pub with a palm pilot), drinking_buddy 2.0 was far superior to it's web-based ancestor.
Now that you can't go anywhere without finding a hotspot, I thought a web based application was in order. As I was writing the back-end, I realized that not everyone carries their laptop around with them everywhere, like I do. And I also though, I don't want to pull this thing out, power it up, log onto someone's network, EVERY time I get a drink. What a hassle. Then I realized what EVERYONE had, all the time, no matter where they were: a cell phone with text messaging capabilities.
Enter drinking_buddy 3.0. Without comments and whitespace lines, this snip of bash script weighs in at 40 lines. To use it, simply send a text message (or an email) to drink@colossalman.com with one of the following words as a subject line:
can
pint
shot
wine
101
151
200
check
These words are not case sensitive, so capitalize them if you must (my phone does it automatically), it should still work. Here's a breakdown:
can: Hi. I am drinking a 12 ounce can of beer.
pint: I am drinking a pint of beer.
shot: I am drinking a shot of 86 proof liquor, or a mixed drink with 1 86 proof shot in it.
101: I'm enjoying a shot of ice 101, or some 100(ish) proof shot or bevvy.
151: Everyone loves Bacardi!
200: I am so pathetic I'm drinking rubbing alcohol straight up.
check: I'm just checking to see how I'm doing here.
The gender specific-ness is gone, "guess my weight" is also gone (just seemed too complicated for a text message app) And of course, the rule of averages apply, the script is assuming a lot.
Beers and Pints are considered to be about 5% alcohol, which is what Pabst has (while Guinness is a mere 4%) wine, shot, and can increase your BAC by the same amount (0.0200), a pint increases it 0.0266, 101 increases it 0.0234, 151 increases it 0.0352, and 200 increases it 0.0465. 200 should probably call the local authorities and let them know all hell is going to break loose. Instead it raises your BAC 0.0465. check won't increase it at all, but will report your estimated BAC back to you. (drinking something will also report back to you your new BAC). Anything else just gives you a bit of usage info.
The algorithm is pretty simple. On average, human beings metabolize 0.02 per hour. Naturally this differs from person to person, but it's a good rule of thumb. That's about 0.00000555556 per SECOND (that actually comes to 0.0198 per hour, so you are possibly metabolizing slightly faster than drinking_buddy 3.0 will tell you) so it's accurate enough for our needs.
DO use this to have fun and play around with your friends and have contests about "who's drunkest". DON'T use this to determine if it is safe for you to drive home. If you need to ask a computer if you're OK to drive (or who you should date) then you are obviously too drunk to get behind the wheel, unless it is way behind the wheel, like in the back seat.
This is a multi-user application, it stores your current BAC and a time-stamp in a file specifically for you, based on your email address. It does not keep a running total, I won't be able to look through the logs and see what you've been drinking at what time, and no one else will be able to either. I will be able to, if I wanted to, which I don't, see how drunk you were the last time you checked in, if I know your phone's email address. But I promise not to abuse my power.
Enjoy!

Pabst, and pretty much any other beer in a can, is 3.2% alcohol by weight. Many states won't sell anything stronger in grocery stores, so your regular swill stays under this limit.
Posted by: Dave at May 12, 2007 10:26 AM