Dec 3, 2009

Guitar Chords - Hithaamain Roala Roalaa [Lemon Band]

at least I think it's them. Certainly sounds like them. In either case it's a great composition. Try singing it to your long lost love and see if she comes running.

you can find the song on dhimp3

in chordpro format again :) some of you hate it I know, but like I said before, you could always go to webchord and get a more readable output.

enjoy. MORE CHORDS

{t:Hithaamain Roala Roalaa}
{st:Lemon Band?}
#compiled by KudaNai - http://kudanai.blogspot.com
#no copyrights claimed

{c:opening chord strum open CaddG}

{c:chorus}
{soc}
hit[C]haamain roal[Am]a roala,karuna oh[F]oran
bika haalug[G]aa jehumun, nuv[C]isneythee kal[Am]aa yah
bunedheyshe ham[F]ajehumei mihit[G]hah
nethee keevvek[C]an
{eoc}

{c:picking}
{sot}
C        Am        F         G
e |-----8--------8--------8----------8------8|
b |--8----8---6----8---5----5---5h6----6----8|
g |----5----5---5----5---5----5-----5----5--5|
d |------------------------------------------|
a |------------------------------------------|
E |------------------------------------------|
{eot}

r[C]oe faa buneemey dhen nudh[Am]aashey
ma[F]a gaai vevijje kan vee goth[G]un
a[C]adheys kureemey dhen ruh[Am]ey tho
m[F]aalas vi kamugaa bunelum[G]un

ehanas hith[C]un, keikoh hur[Am]un noon gothei
anek[F]unna? adhu baakeee vum[G]un

{c:chorus}

h[C]ithakah libey hama ufalak[Am]ee hey?
k[F]ushakaa nulaa fahe dhera dhin[G]un? hmmm..
n[C]oonee sikundiyah buravane[Am]e hey?
i[F]nsaafuverikoh visnaalum[G]un

namaves fah[C]un, annaane kam[Am]ugaa heekuran
haasil nuv[F]eema loaibeh mi dh[G]uniyeyn

{c:chorus}

u[C]mmurah hithaamaigaa ul[Am]hen hey?
e[F]dhenee thibaa hama abadhah mih[G]en? bunedhee dhulun,
h[G]aasil nuvaahindhu ufalei mid[Am]huniyeyn,
b[F]arudhaasthu kuramun dhaa mi v[G]eynun?

{c:chorus}
{c:during this chorus, the chords are a full step up}
{c:i.e, D, Bm, G, A}

bunedheyshe hamajehumei mi-hithah, nethee keevve kan...
bunedheyshe hamajehumei mi-hitha, nethee keevve kan...
.....

Nov 24, 2009

Guitar Chords - Ilaahi mi bin (Unoosha's version)

Hey peeps.

This is one of my all time (and your) favourite classic of classics transcribed for the acoustic guitar. I'm sure no self respecting Maldivian needs a second introduction to this song (if you do, ask your mom). Note that this is based on Unoosha's rendition of the song and not the original. If you see this Kiddy, you did a great job.

You can find her version on her facebook fan-page HERE.
the original should be somewhere on youtube.

btw, if anybody is wondering if this is an "original maldivian" song, it's not.

Hindi Song

Ideally played on two guitars.

oh and before you go and steal my work and claim all the credit...fuck you... you guys suck. You know who you are. The rest of you, enjoy these guitar chords of ilaahi mi bin (ilahi mi bin,ilaahee mi bin etc...) (sorry..google search ;))

Check out the rest of my chords and stuff.


{t:Ilaahee Mi-bin}
{st:Unoosha's version}
#compiled by KudaNai http://kudanai.blogspot.com
#No copyright claim

{c:A slow arpeggio picking works nicely with this.
It's meant to be a slow song, so don't rush it.}

{c:intro}
{sot}
A D A D
e |------------12-----|-12-14 16-17-14-12-|
b |----12-14 15-------|-------------------|
g |-14----------------|-------------------|
d |-------------------|-------------------|
a |-------------------|-------------------|
E |-------------------|-------------------|

A D Bm E
e |-12-14-16-17-14-12-|-------------------|
b |-------------------|---14-14-15-12-12--|
g |-------------------|-------------------|
d |-------------------|-------------------|
a |-------------------|-------------------|
E |-------------------|-------------------|
{eot}

{soc}
[A]ilaahee mi bin,kur[D]avaandhey am[A]aan
mi-al[D]haage uf[A]an dhiveh[Bm]een ge mi b[E]in
thib[A]aa hazrathun, oh[Bm]ey madhadhun
fil[A]aa numedhaa, dhiveh[E]eenge mi b[A]in
{eoc}

{c:interlude}
{sot}

A Bm C#m E A
e |-0--------|-2--------|-4--------|-7------5--|
b |----2-----|---3------|----5-----|----9---5--|
g |-------2--|------4---|-------6--|--------6--|
d |-2--------|-4--------|-6--------|-9------9--|
a |----------|----------|----------|--------9--|
E |----------|----------|----------|--------5--|
{eoc}


mith[D]aange vayaa, mith[A]aange fenaa
mith[D]aange kandaa, ek[A]anduge oyaa
gath[D]aa uthares, mi r[A]ukuge fanaa
mith[D]aa mi alh[E]aa ge g[A]ulhifaivaa

gudhur[A]athuge il[Bm]aahee n[E]iumathuga
ab[E]dhuge abadh[D]ah dhirem[A]un dhiremun


{c:chorus}
{c:interlude}

mig[D]aumuge kaa'baf[A]ainge leyaa
ek[D]ashithah ekuve d[A]hiya veyya
miy[D]avvure vaki az[A]eezu thanei
nuv[D]aa mi alh[E]aa uf[A]an vi hiyaa

thiya math[A]iveri r[Bm]ahumathug[E]aa lavva
barak[E]aathuge v[D]aarey vi[A]ssavamun

{c:chorus}

{sot}
e |-----------5-7-9-10-12-14-16-17--|
b |---------5-----------------------|
g |-------6-------------------------|
d |-----7---------------------------|
a |---7-----------------------------|
E |-5-------------------------------|
{eot}

Nov 18, 2009

Replying to Facebook mail on command line

this is a little helper script that I wrote to use in conjunction with FBCMD to reply to inbox messages directly on the command line without going to the website.

It takes two args, the message number (as given out by fbcmd inbox) and the message itself. pretty straightforward. Just throwing it out there.

it's meant to be used with fbcmd, but if you like you can provide a thread_id to it as well (slight mod might be needed)



#!/usr/bin/perl

use strict;
use WWW::Mechanize;
use HTTP::Cookies;

my $username = 'youremail';
my $password = 'yourpass';
my $maildata = "/home/youruser/.fbcmd/maildata.txt";

my $msgid=`php -r \"\\\$ld=unserialize(file_get_contents('$maildata'));print \\\$ld['ids'][$ARGV[0]];\"`;

my $mech = WWW::Mechanize->new();
$mech->cookie_jar(HTTP::Cookies->new());

$mech->get("http://lite.facebook.com/login/");
$mech->submit_form(form_number => 1,fields =>{email=>$username,password=>$password});

$mech->content() =~ /\/w\/(\w+)\/logout/;
$mech->post("http://lite.facebook.com/w/".$1."/inbox/reply/".$msgid."/",{message=>$ARGV[1],__async__=>'true'});

Oct 4, 2009

Guitar Chords - Yaaraa Hinithun Veema

Hey peeps... been a while. Just throwing something out there real quick. This is another timeless classic from...errr... I'm not sure who the original artist is for this one. If anybody knows throw me a bone in the comments.

I've decided to use the ChordPro format to upload chords from now on for convenience sake.you can find out more about the format HERE. You can use the CHORD program to prettify the layout if you like. OR visit http://webchord.sourceforge.net/ and paste it in the provided text field to get a prettified output on the fly.

check out my other uploads http://kudanai.blogspot.com/search/label/music
{title:Yaaraa Hinithun Veema}
{st:artist - unknown}
#chorded by KudaNai
#http://kudanai.blogspot.com
#thanks hassaan
#no copy rights claimed

{c:chorus}

{soc}
[G]yaaraa hinithun v[D]eema,hurev[C]eyne hey mih[G]en
[G]yaaraa beynun v[D]eema,dhuruv[C]aane hey ma [G]dhen
[Am]veemaa naah[D]aashey keevve [G]hey,adhi
[Am]noonee nubun[D]aashey noonek[G]ey
{eoc}

{c:chorus}

[Am]maamaluge meeru [G]vas thakun, [C]maazee handhaan va[G]nee
[Am]loabee ge inthi[G]zaaruga,[C]mi hihiyaalu aavanee
[Am]naahaashey [G]keevvehey,nubu[Am]naashey [G]noonekey
[Am]hiy-ves dhineem[D]ey

{c:chorus x 2}

[Am]kairin kalaa bal[G]aalumun,[C]neyngeyhe veego[G]thei
[Am]sirrei bunan handh[G]aanvefa,dh[C]oo bandhuvee mag[G]ey
[Am]naahaashey [G]keevvehey,nubu[Am]naashey [G]noonekey
[Am]hiy-ves dhineem[D]ey

{c:chorus}

Jul 16, 2009

Facebook inbox count for conky/others

YAFS again! I'll just throw this out there.

small perl (c-ish again I guess) script to get number of unread messages in facebook. for use with conky etc... supply username and pass as args.


#!/usr/bin/perl
use strict;
use WWW::Mechanize;
use HTTP::Cookies;

my $username = @ARGV[0];
my $password = @ARGV[1];

my $mech = WWW::Mechanize->new();
$mech->cookie_jar(HTTP::Cookies->new());
$mech->post("https://login.facebook.com/login.php?m&next=http://m.facebook.com/inbox",{email=>$username,pass=>$password});
$mech->content() =~ /Inbox\s\((\d+)\)/;

print $1?("$1 New Message".($1>1?"s\n":"\n")):"0 New Messages\n";

Jul 12, 2009

Uploading photos to Facebook groups with Perl

here we go again, YAFS (yet another facebook script)

a little different this time since it's in Perl, which is new to me. This script takes a list of file names as arguments, and uploads them to a specified group on facebook. It uses WWW::Mechanize (which is awesome) to do the heavy lifting, and also depends on imagemagick (to resize images)

do note however that this was NOT written to be platform independent so windows users might encounter some problemns. However it should be fixable with a little modification.

USAGE

you'll need to edit the lines for your user-name and password.

perl gup.pl GID [file1] [file2] ...
where GID is the concerned groupID. You need to be a member of the group, and should have upload rights to its photo album.

#!/usr/bin/perl
# -----------------------------------------------
# Script to upload photos to a Facebook group.
# 2009 - kudanai, http://kudanai.blogspot.com
#
# This script can act as a nautilus extension.
# (preset GID and set $i=0 on line 59)
#
# This program is distributed in the hope that
# it will be useful,but WITHOUT ANY WARRANTY;
# without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.
# -----------------------------------------------

use strict;
use WWW::Mechanize;
use HTTP::Cookies;

#edit your username, password and group_id here
#these values MUST BE CORRECT for the script
#to work properly
my $username = 'username@example.com';
my $password = 'password';
my $gid = $ARGV[0];

#-----no need to edit beyond this point-----

#url for login page + redirect instruction
my $url = "https://login.facebook.com/login.php?" .
"&next=http%3A%2F%2Fwww.facebook.com%2Feditalbum.php%3Foid%3D".
$gid."%26add%3D1%26htmlup%3D1";

#initialize objects
my $mech = WWW::Mechanize->new();
$mech->cookie_jar(HTTP::Cookies->new());

#notify
#system("notify-send -i fbnotif UPLOADING \"Logging in\"");

$mech->get($url);
$mech->submit_form(
form_number => 1,
fields =>{
email=>$username,
pass=>$password
},
button=>'login'
);

#notify - if you have libnotify installed, uncomment
#these notify commands to get progress notifications
#system("notify-send -i fbnotif UPLOADING \"Uploading photos\"");


#loop through args and post the files
#five at a time.

my $i=1;
while(defined $ARGV[$i])
{

$mech->form_name('upload');
for(my $j=1;$j<6;$j++,$i++)
{
if(defined $ARGV[$i])
{
system("convert -resize 604 \"".$ARGV[$i]."\" /tmp/".$j.".fgup.jpg");
$mech->field("file$j"=>"/tmp/$j.fgup.jpg");
}   
}
$mech->tick('agree','1');
$mech->submit();
if(defined $ARGV[$i]) {
$mech->back()
}
}

#remove temporary images
system( "find /tmp -name '*.fgup.jpg' -exec rm {} \\;>/dev/null" );

#notify
#system("notify-send -i fbnotif UPLOADING \"Finished Uploads\"");

Jul 8, 2009

Removing dead/orphan entries from f-spot's database

This seems like a common problem for a lot of people -

dead or orphaned entries in f-spot :| technically, you shouldn't go behind f-spots back and delete the files directly, but sometimes ...well shit happens. like for me, I somehow managed to re-import the same pictures into my database twice..and was left with a crapload of duplicate images in my album..

the first problem is easily solvable, simply running

fdupes -dN

removes the duplicate entries in the given directory (use with caution)

but that still left us with f-spot's internal database still linking to dead entries

this makes me very sad...very very sad, as f-spot doesn't have a "refresh catalog" option.

so I came up with this not-so elegant but it works solution... so here we go

PROCEED WITH CAUTION....CAUTION I SAY!!! NOTE THE PROCEDURE BELOW WILL REMOVE REFERENCES TO MODIFIED VERSIONS AND SHITE AS WELL...


1.backup your database
cp ~/.gnome2/f-spot/photos.db ~/.gnome2/f-spot/photos.db.backup
CHECK CHECK AND DOUBLE CHECK if that worked..

2.extract the photo information
sqlite3 ~/.gnome2/f-spot/photos.db 'select id,uri from photos;' > entries
3.check for the dead entries

cat entries | while read i;do if [ ! -e "$(echo ${i} | cut -f2 -d'|' | sed 's/file:\/\///g')" ];then echo ${i};fi;done > deads

watch for line breaks...the above is a single line! Give it time to process...it may take a while depending on your db size (mine took 4 minutes)

4.delete the entries from the main table

cut -f1 -d"|" deads | while read i;do sqlite3 ~/.gnome2/f-spot/photos.db "delete from photos where id=${i};";done
.... AND from the version table

cut -f1 -d"|" deads | while read i;do sqlite3 ~/.gnome2/f-spot/photos.db "delete from photo_versions where photo_id=${i};";done
5. Now remve the working files you created

rm entries deads

and tadaaa!!!!!

a few things to note
1.it's not perfect
2.if you have edited versions, and the original is missing, references to edited versions will be removed.
3.you can fine tune the SQL in step 2 to restrict removals to specific folders or such;
eg:
SELECT id,uri FROM photos WHERE uri LIKE '%/2009/07/%';

Jun 29, 2009

Automatic birthday wishes on facebook

here we go yet again...another update. This time, aimed at trying to make the whole thing less complicated for people, and also remove the whole linux limitation thing as opposed to the older version that I put up three months ago. The response to this has been quite positive...

presenting... keyku 

This new version has been setup as a facebook application and not a hack, so it's more elegant this time, and errr.... a bit more...legal let's say (the old version violated the facebook terms of use a little...this one does not)

setup instructions can be found on the application page

feel free to drop in there and tinker around, suggest features, flame the discussion board etc :P

have fun.

once again, thanks to Dave Tompkins for his help.

May 26, 2009

Upload photos to facebook from Nautilus

EDIT:
~UPDATED 15-07-2010
Added ability to create album.
Photo's will be auto-rotated if EXIF information is available.
12-JUN-2010
reworked the mechanism to work with the new FBCMD.
Does not need a manual update of albumdata file (will be handled on it's own.)

If you run this on a directory, it will upload all *.jpg files in said directory.

30-MAY-09

Fixed stupid bug where the cancelling uploaded the picture anyway.Thank you Mr. Anonymous bug reporter.

It's been a while since I've posted an update, not that I suspect that anybody missed me or anything. Nonetheless I'm throwing out an obligatory apology and the explaination for it being "been busy"

anyway this is something I whipped up today that somebody might find useful. It's a nautilus script that uploads your photos to facebook. So you can just right-click on a photo and upload it there.It's fairly basic (offers multiple uploads,album-selection, no-tagging,no caption), and once again it's not completely idiot proof so I'm not taking responsibility if you muck something up.

currently this depends on the following
  • libnotify (particularly notify-send)
  • zenity
  • imagemagick
  • fbcmd (and hence php)
fbcmd here being the facebook command-line application by Dave Tompkins, which can be found at http://fbcmd.dtompkins.com. So once you have that up and running and properly authorized (find instructions on fbcmd page)

The script needs to go into ~/.gnome2/nautilus-scripts


Next you should setup an albumid file because it's faster if you maintain a local list). Do this by running

php fbcmd.php albums | tee ~/.fbaids

if you'd rather fetch album information from facebook everytime you can replace the line "aidlist=~/.fbaids" with "aidlist=\"$(php FBCMDPATH albums)\""
that should do it.


please note that I haven't implemented a check on weather the upload was successful or not. Also there is no filetype check so be careful.

#!/bin/bash
# AUTHOR: (c) Naail Abdul Rahman (http://kudanai.blogspot.com)
# VERSION: 1.0
# LICENSE: GPL (http://www.gnu.org/licenses/gpl.html)
# REQUIRES: libnotify, zenity, FBCMD (http://fbcmd.dtompkins.com),imagemagick
# NAME:  Upload to Facebook
# DESCRIPTION: Simple nautilus script to invoke FBCMD upload functionality.
#  Currently only supports pictures.Hope to adding notes as well.
#  FBCMD is a command line interface to facebook by Dave Tompkins
 
fbcmdl=fbcmd #command to invoke fbcmd...usually just fbcmd
 
function notify() {
 notify-send -i fbnotif UPLOADING "$@"
}
 
function makealbum() {
 title=$(zenity --entry --title="Title?" --text="Enter Album Title (Required):")
 if [ -z $title ]
 then
  getaid
 fi
 
 desc=$(zenity --entry --title="Description?" \
  --text="Enter a description for the album (optional):\nLeave blank if you don't want to set a descroption")
 location=$(zenity --entry --title="Location?" \
  --text="Enter a location for the album (optional):\nLeave blank if you don't want to set a location")
 privacyOpt=$(zenity --entry --title="Privacy?" \
  --text="Who can see this album? (default:everyone)\n1.friends\n2.friends-of-friends\n3.networks\n4.everyone")
 
  case $privacyOpt in
   1) privacy="friends"
    ;;
   2) privacy="friends-of-friends"
    ;;
   3) privacy="networks"
    ;;
   4) privacy="everyone"
    ;;
   *) privacy="everyone"
    ;;
  esac
 notify "creating album $title"
 $fbcmdl addalbum "${title}" "${desc}" "${location}" $privacy
}
 
function getaid() {
 
 aid=$(zenity --entry --title="Album?" \
   --text="Enter AlbumID or #\n\nenter:\n  0 for list\n  l (low L) for latest\n a for new")
  
 if [ -z $aid ];
 then
  echo "null value for aid - quiting"
  notify "upload cancelled"
  exit
 else
  case $aid in
   0) echo "please wait, fetching album data"
    $fbcmdl albums | zenity --text-info \
       --title "album names and stuff" --width=600
    getaid
    ;;
   l) aid="latest"
    ;;
   a) makealbum
    echo "created album.."
    aid="latest"
    ;;
  esac
 fi
}
 
getaid
notify "uploading photos"
  
for arg
do
 if [ -f $arg ]
 then
  echo "adding regular file ${arg}"
  convert -auto-orient -resize '604>' "$arg" /tmp/fbuplpictmpxx.jpg
  $fbcmdl addpic /tmp/fbuplpictmpxx.jpg $aid
 elif [ -d $arg ]
 then
  echo "uploading directory ${arg}"
  $fbcmdl addpicd $arg $aid
 fi
done
 
notify "upload finished"
exit

Apr 14, 2009

Guitar Chords: Aadheys (Amir)

Here goes another popular song. This may not be entirely accurate (so feel free to criticise and belittle) , but it's playable. This is another one of those melodic tunes you can just strum along to...hum...try to woo somebody with etc..

The original tune is a half step up (I think).
This is in C, so if you want to play it like
it sounds slap on a capo (1st fret)or substitue
the chords like so:

C = Db
G = Ab
F = F#
Am = F

Enjoy!

C
thee neyvaaa ey magey
C               G
vindhey thee magey
hithaa furaanaige dhirumey
F                         C
thee noon hey reydhuvaa magey

thee ummeedhey magey
maazee ey magey
dhelo fureyney dhiyaimaa
thee noon hey loabivaa magey

Am                  G
heyo nuvaaney rovvaafaa nudhaashey
Am                G
loabivaa ey annaashey
F
aadheyhey mee kuraa
C
hutteyshey!

Am                    G
maafu dheyshey, heelaashey
Am               F          G
kukkurevijjeyey, kukkuree mashey..

thee raanee ey magey
milkey thee magey
govaanamey loabi vaathee
thee noon hey aashigaa magey

thee manziley magey
raasthaa ey magey
niyaa ivey tho hureemey
thee noon hey saahibaa magey

heyo nuvaaney dhookoffa dhiyaimee
roala roala hureveynee
aadheyhey tho inthizaar
kureveynee!

hoadha hoada, hureveynee
is ufulaaladhee, hiy magey roneee...

Apr 12, 2009

Guitar Chords: Raarukugaa (Trio)

....and here we go, another instalment from my guitar chord series. Let's hope this one doesn't get ripped off as well! If you're gonna, at least leave a comment here or something. Be nice.. don't be an asshole.

Thanks to mvlyrics for the lyrics


Right here we go then, a video of the song first








And now for the chords

The song basically has three chords: Am F and G
just cycle through them over and over. The intro
picking is simple, however the way they play the
chords are slightly different. here

Am - x7750x
F  - x3320x
G  - x5540x

for the main verses and then for the saharo 
part you play the regular barre chords. 

and so the song goes like so - Enjoy.


Am         F         G          Am
raarukugaa ma ovvaa, aligulhaeh fenijjey
Am         F         G            Am
sissaigen gos athun, raabadhi dhoo vejjeyey
Am         F         G          Am
raarukugaa ma ovvaa, aligulhaeh fenijjey
Am         F         G            Am
sissaigen gos athun, raabadhi dhoo vejjeyey


Am         F         G             Am   
maa kairin fenilumun hithu vindhu avasviyeye
Am         F           G              Am
fai vaagi nethen feshy thuruthuru laa goehviyey
G          Am
heyverikan kudaviey

Am           F     G             Am 
saharo ekaifiyeye, saharo maraifiyey
eynaa eba aadheyey,saharo ekaifiyeye
saharo ekaifiyeye, saharo maraifiyey
eynaa eba aadheye, saharo ekaifiyeye

irukolhakun kuda soreh roahen hama heeviyey
muskulhi koru dhaithayeh hingamun eba aadheyey
irukolhakun kuda soreh roahen hama heeviyey
muskulhi koru dhaithayeh hingamun eba aadheyey

raarukugaa ma ovvaa kalhieh eh laifiyey
adakun asthaa nubai heyn eynaa fettiyey
heyverikan kuda viyey

saharo ekaifiyeye, saharo maraifiyey
eynaa eba aadheyey, saharo ekaifiyeye
saharo ekaifiyeye, saharo maraifiyey
eynaa eba aadheyey, saharo ekaifiyeye

##(I'm not sure about the chords they play here
I just leave it out)##

vai baaruve mulhi valah thoofaaneh aissiyey
inzaaru maruge hithah dheyhen eba heeveyey
vai baaruve mulhi valah thoofaaneh aissiyey
inzaaru maruge hithah dheyhen eba heeveyey
ruh dhoshugaa buru alhan kalhu bulhaleh fettieyey
thin buru hamavythanaa nidhi varubalivejjyey

saharo ekaifiyeye,saharo maraifiyey
eynaa eba aadheyey, saharo ekaifiyeye
saharo ekaifiyeye, saharo maraifiyey
eynaa eba aadheyey, saharo ekaifiyeye
saharo ekaifiyeye, saharo maraifiyey
eynaa eba aadheyey, saharo ekaifiyeye
saharo ekaifiyeye, saharo maraifiyey
eynaa eba aadheyey, saharo ekaifiyeye

Apr 3, 2009

You thieving bastards!!!

A few days ago I noticed that some people have been "borrowing" my work without giving me due credit. Now normally I would not make a big deal out of such a thing. It's a free world, and there is no policing the interwebs. Everybody knows that, and anybody trying to fight it is... well stupid. That said, it's still a really ass-hole thing to do to so blatantly claim that a particular piece of code or guitar tab is your very own work when you didn't even bother to change any of it. You could've at least corrected the spelling mistakes that I'd made. I mean come on dude!!!...

so this one's out to the guy who stole my shit... and is probably feeling good about it thinking he the man. Nice going sir. You suck! but I'm happy for you.

Mar 23, 2009

Let's get poking - (facebook poke with bash / perl)

facebook, bash, curl, poke..poking... that about covers it. This is neither elegant nor complete. Call it a "hack" if you will. Please keep in mind that facebook does not look favourably on browser side scripting so this is technically against their TOS. Having said that, unless you go all spammy on your friends, you should remain under the radar. As far as requests go, they'll think you're doing it manually..which is ok... (unless like I said you over do it..)

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

Mar 6, 2009

Automatic Birthday Wishes on Facebook

EDIT: 29/06/2009 - a new, better and more elegant version has been released. I encourage users to switch over to that one.
Announcement is HERE

Well here we are again. Update time! :|

A few months ago I put together a little script that would automatically write on the walls of any of your friends of Facebook (limited to privacy settings of said individuals of course). The script was/is largely based on the Command line application by Dave Tompkins.

as of the most recent update, my script is no longer compatible with the new version. So a few changes were in order. So here it is.

unlike the previous version, you don't need to patch anything. Just a vanilla install of fbcmd + this script and that's it.

download script from HERE


Installation:

1.Download and install fbcmd, follow instructions from HERE
2.Download my script, and put it anywhere you want.
3.Edit the email,password fields in the script: and locations of the fbcmd files
4.Run it manually, or setup a cron job for it.

the setup should be fairly straightforward. Please note that the wall post procedure is not officially supported by facebook, and may break from time to time (because facebook may change their page structure). Please report any bugs ASAP and I'll will try to have them fixed as soon as I can.

have fun!

Jan 12, 2009

well holidays...

pardon my lack on enthusiasm, the day hasn't exactly been the best of days.