EDIT 3: 02/DEC/08 - Fixed birthday issue for single digit days. Damn paddings...
EDIT 2: 23/NOV/08 - Fixed the incorrect date matching problem. You should update before the 2nd of December or you'll be in trouble.
EDIT: I fixed one serious error in the code, and updated the how to and made it..simpler.
let's face it, no matter how much you try you will always forget somebody's birthday and end up in a hole. I've been " " this close to death on several occasions now, and I'm actually reputed for having a good grip of the whole birthday business.
so last night I wanted to kill some time and I came up with a little bash script that might be of help to some of you. Basically what it does is
- Go online and grab the user ID's of everybody who's birthday falls on "today" (make sure your system clock is setup properly)
- Write a message on their wall
This is setup to run once a day, and voila! you have yourself a free ticket out of...birthday forgetters hell... *cough*
Should be fairly straightforward on any *nix system.
We'll be needing some way to access information on facebook. For that we're going to use fbcmd which is, as the developer describes "a simple command line interface for facebook." Go to the projects website here and download the latest version. At the time of writing, this was 0.90 (BETA)
Note that the patch file provided is for this particular version. I will update it if necessary in the future.
extract the archive to your home directory (places->home).
now download the patch file and script from here and also extract it to ~/fbcmd (directory should already exist from the previous archive)
Now go to the facebook application page, HERE and allow the application to access your information, and click "generate" to get an AUTH CODE for your account. Copy this down
open up a terminal now and run the following commands, one at a time.
sudo apt-get install curl php5-cli gnome-schedulewhere XXXXXX is the AUTH CODE you copied down earlier. Now you should have access to your account through the application. Now we can move on to the wish script. In the same terminal type out the following.
patch -b -i fbcmd.diff fbcmd.php
php fbcmd.php AUTH XXXXXX
php fbcmd.php FRIENDSC > fbUIDlistwhen the editor pops up, change the values for email, pass and put in your email ad and password. Change the value of "post" to whatever you want your friend to be greeted with. (TIP: avoid !'s, it causes some problems)
gnome-scheduleThe scheduled tasks dialog should come up. Click on new->recurrent. Enter any description you like. In the command field type
~/fbcmd/fbbdaywish >> ~/fbcmd/bday.loguncheck the "no output" option, and select "every day" from the drop down menu. Click ok, and you're set to go!
Let me know how it turns out.