Code: Select all
on *:sockopen:fbid~*:{
if ($sockerr) { $2-3 Socket Connection Error! | return }
tokenize 124 $sock($sockname).mark
var %fbid = sockwrite -nt $sockname
%fbid GET $+(/,$1) HTTP/1.1 | %fbid Connection: close
%fbid Host: $+($sock($sockname).addr,$str($crlf,2))
}
on $*:text:/^!fbid\s(.*)/iS:*:{
if (!$($+(%,control,.,$site,.,#,.,$network),2)) {
inc -u5 $+(%,control,.,$site,.,#,.,$network)
var %1 = $regml(1), %f = $+(fbid~,$ticks)
sockopen %f graph.facebook.com 80
sockmark %f $+($remove(%1,$chr(32)),|,.msg $iif(#,#,$nick),|,$&
FaceBook Info About %1 ->,|,http://www.facebook.com/profile.php?id=)
}
}
on *:sockread:fbid~*:{
tokenize 124 $sock($sockname).mark | var %link = $4 | sockread &fbsockreader
var %fb = $bvar(&fbsockreader,1-).text | if ($sockerr) { $2-3 Socket Reading Error! | return }
elseif (error isin %fb) { $2-3 There is No Such Facebook User Named $qt($1) Found! }
else { noop $regex(%fb,/"id"(.*)/) | var %fbid. = $regsubex($remove($regml(1),:,$&
$chr(44),$chr(125)),/""|"/g,$chr(32)) | $remove($2-10,%link) ID: $token(%fbid.,1,32) $&
<> $replace($token(%fbid.,2-4,32),name,Full Name:) <> Gender: $&
$iif($regex($token(%fbid.,4-,32),/gender\s(\S+)/),$regsubex($regml(1),/^(.)/,$&
$upper(\1)),None) <> Country: $iif($regex($token(%fbid.,4-,32),/locale\s(\S+)/),$&
$regml(1),None) <> FaceBook Link: $+(%link,$token(%fbid.,1,32)) | sockclose $sockname
}
}