Automatically Post Happy Birthday for Facebook Birthdays


It’s interesting that the most read page on my blog is the one on creative ways to say happy birthday. There are numerous google searches that direct visitors to that page every month.

I’ve been told by the comments below that if you want to automatically post a happy birthday message for your Facebook friends, birthdayFB will do this for you.

This is a somewhat related post about how I’m trying to write a computer program that check’s Facebook for my friends’ birthdays and post a happy birthday wish on their wall. I can then schedule this program to run once a day, each time posting a canned response to their wall, and I’ll never have to worry about not saying happy birthday again.

How to Tweet Automatically With a PHP-OAuth Twitter Bot


UPDATE: I did this better in Python here

One day I tweeted “Treme & Engineering – Fight Club & Anti-Consumerism,“ and was immediately answered by a Twitter account IAmJacksBot whose user was “Tyler Durden.” After looking at this Twitter account, I realized it was run by a computer program that searched recent tweets for the words “fight club” and simply responded to them with a random quote from the movie. Needless to say, this is pretty awesome and inspired me to do the same with some of my favorite television characters.

I’ve set up a Jimmy McNulty Twitter bot. For those of you who haven’t seen The Wire, which is only the best television series ever, McNulty is an insubordinate Baltimore police detective who gets on everyone’s nerves. He’s an alcoholic, adulterer, womanizer, irresponsible father, and an all around asshole, but you gotta love how he pursues tough criminals so tenaciously.

My McNulty bot tweets an arbitrary quotation from the show every three hours. So how can you set one up?

Economist Python Web Scraper


Here’s a Python web scraper that gives you the full print edition of The Economist for free. Or you could go to their print edition that’s online and reject their cookies.

Public Speaking: Get Noticed at Your Workplace


If you’re at your first job after college, I have important advice for you. If you get a chance to speak or present to a large audience at work, take it. I cannot overstate the significance of skills like public speaking, rapport-building, and simply getting noticed.

When I stand in front of a group of more than five people, I become nervous. My voice shakes, I talk too fast, I don’t maintain eye contact. But if I prepare just a little bit beforehand, my performance improves dramatically. Here are some simple but often overlooked points for delivering effective and coherent public speeches.

How to Convert HTML Character Codes Into Unicode


I’ve improved my Python New York Times web scraper that extracts the global home page’s top articles. The latest version doesn’t clumsily replace HTML character codes like “é” with “é”. I wondered if there was a way for Python to convert it. It turns out there is.

Here’s the trick:

Why I Like Python More Than Perl


Update: After programming more and reading this post again, I realize I was still a noob when I wrote this and titled it “Why Python Is Better Than Perl.” Languages are tools. Tools are not objectively better or worse than others. It depends on the task.

A month ago, I began learning Perl. Two days ago, I began learning Python. I’m already a convert.

Python makes programming fun. It’s more readable, doesn’t have funky $, @, % symbols everywhere, and whitespace like tab and return handle program logic so that I can stop worrying about semicolons and curly braces. In addition, Python seems to be more widely favored by natural language processing researchers. There are quite a few at my workplace, and as a Perl user, I couldn’t communicate with them at all. They’d speak Python while I’d be blathering in Perl. In order to tap into the NLP community and all the NLP goodies (like this), I switched to Python to the dismay of a systems administrator (click here if you have no idea what that is) and Perl-loyalist who sits near me at work.

Despite the similarities between Perl and Python regular expressions, a way of matching text, I still favor Perl’s. But my Python translation of my Perl script that web scrapes the New York Times is only half the length and more understandable for humans. The Perl script runs twice as fast, but that’s something I can live with.

Now I can relate to this xkcd comic.

Amazon Kindle 3 Pros and Cons


I bought Amazon’s Kindle 3 a week ago and have read a mix of plain text files and PDFs (Edgar Allen Poe short stories and math textbooks). Last time, I wrote about my initial satisfaction, and a week later I’m still happy with the reading experience. The electronic ink doesn’t strain my eyes, page turning is fast, and the choice of fonts and page orientation is suitable. The Kindle renders PDF files well if you orient the page layout to landscape instead of portrait. You can see the page in close to normal size this way.

Why You Should Learn Perl and How to Install Modules Without Headaches


I’ve become a fan of the computer programming language Perl after my friend who majored in computer science recommended learning Perl over Python a month ago. For the longest time, however, I was getting pissed off trying to use it on my Mac.


Perl is a high-level computer language nicknamed the “Swiss Army chainsaw of programming languages” for its flexibility and adaptability. It can collect Edgar Allen Poe short stories from the Internet, calculate the similarities between them, and store that information in a database. Perl is free and is supported by tons of how-to books and online tutorials (e.g. here, here, and here). You don’t have to be a computer geek to learn Perl. You’d probably think of new applications for Perl by approaching it from a non-technical standpoint.

Now that I’ve convinced you to learn Perl, how do you get started?