| View previous topic :: View next topic |
| Author |
Message |
Zecca93 Voice
Joined: 26 Apr 2012 Posts: 13
|
Posted: Thu Apr 26, 2012 9:20 pm Post subject: Search facebook profiles from MirC to TCL Help |
|
|
Can someone plz help and turn this to tcl . Thanks
| Code: |
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
}
}
|
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Fri Apr 27, 2012 12:05 pm Post subject: |
|
|
From the forum rules, you agree to when you registered on this forum...
>>> This is an Eggdrop/TCL related forum, Neither ask for mIRC Scripts Nor post a new topic for any (mIRC) assistance.
In short... this thread should be locked, junked, similar _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
iRoc Guest
|
Posted: Fri Apr 27, 2012 3:00 pm Post subject: |
|
|
| Code: | package require http
#############################
bind pub - !getid proc:fbid
proc proc:fbid {nick uhost hand chan arg} {
set tok [http::geturl http://graph.facebook.com/$arg]
set data [http::data $tok]
regexp -nocase {"id":"(.*?)",} $data -> fbogid
regexp -nocase {"name":"(.*?)",} $data -> fbogname
http::cleanup $tok
putserv "PRIVMSG $chan :01\[04FaceBook Info\]: >>> 01\[04FaceBook Name\]: $fbogname >>> 1\[04ID\]: $fbogid"
putserv "PRIVMSG $chan :01\[04FaceBook Link\]: http:\/\/www.facebook.com\/profile.php?id=$fbogid"
}
##############################
# ----------
putlog "Facebook ID TCL Script adapted by Denver Freeburn of JimpWare, for Frederik Originally coded by Jethro"
# ---------- |
|
|
| Back to top |
|
 |
Zecca93 Voice
Joined: 26 Apr 2012 Posts: 13
|
Posted: Fri Apr 27, 2012 6:16 pm Post subject: Hmm |
|
|
[18:16:57] Tcl error [proc:fbid]: can't read "fbogname": no such variable
error on ID
[18:18:26] Tcl error [proc:fbid]: Illegal characters in URL path
error on Name :/ can anyone solve this? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|