copy code below to new file
chmod it +x
the script take three args - email,password and UID of the person you wanna poke.
it will try to reuse any cookies left over from a previous session so if you have problems, delete the cookie file /tmp/email.fbcookie
have fun. don't spam!
update
This here is a new modified version running on Perl. working as of 26/03/2010
#!/usr/bin/perl #---------------------------- # # facebook poke script # # c2010 - KudaNai # # http://kudanai.blogspot.com # # --------------------------- # # use with caution.you may # # get banned for violation # # of facebook ToS. # # good luck. # # --------------------------- # use strict; use WWW::Mechanize; use HTTP::Cookies; my $username = 'yourusername'; #change these values. my $password = 'yourpassowrd'; die "invalid number of arguments" unless (scalar @ARGV)==1; my $mech = WWW::Mechanize->new();$mech->cookie_jar(HTTP::Cookies->new()); $mech->get("http://www.facebook.com/login.php"); $mech->submit_form( form_number => 1, fields => { email=>$username, pass=>$password } ); $mech->content() =~ /post_form_id\"\svalue=\"(\w+)\"/; foreach my $uid (@ARGV) { $mech->post("http://www.facebook.com/ajax/poke.php?__a=1", { uid=>$uid, pokeback=>"1", post_form_id=>$1, post_form_id_source=>"AsyncRequest" } ); #print $mech->content(); }
and the old version for reference.
#!/bin/bash email=$1 pass=$2 uid=$3 cookie="/tmp/${email}.fbcookie" login() { echo "logging in..." curl -L --silent -A "MOZILLA/5.0" -b ${cookie} -c ${cookie} \ -d "email=${email}" -d "pass=${pass}" -d "login=Log+In" \ http://m.facebook.com/login.php > /dev/null } poke() { gfid=`curl -L --silent -A "MOZILLA/5.0" -b ${cookie} -c ${cookie} \ "http://m.facebook.com/profile.php?id=${uid}" | \ awk '{FS="gfid=";RS="\">";if (NR!=1 && $2!~/^$/) {print $2}}'` curl --silent -G -A "MOZILLA/5.0" -b ${cookie} -c ${cookie} \ -d "id=${uid}" -d "gfid=${gfid}" -d "poke=${uid}" -d "refid=17" \ "http://m.facebook.com/a/profile.php" > /dev/null } if [ ! -e "${cookie}" ];then login;fi poke