Thank You
i had to use regex and strtok !
i do a request by ID and get the name of the user
anybody find his code .. thanks !
PHP Code:
new g_Socket1;
public getPlayerDetails(id,fbacc)
{
new Error;
g_Socket1 = socket_open("graph.facebook.com",80,SOCKET_TCP,Error);
new Data1[512];
formatex(Data1,511,"GET /%d/ HTTP/1.1^r^nHost:graph.facebook.com^r^nConnection: close^r^n^r^n",fbacc);
socket_send(g_Socket1,Data1,511);
new params[2];
params[0] = id;
params[1] = fbacc;
set_task( 0.5 , "CheckForData1" , TASK_RECV1 , params, 2, "b");
}
public CheckForData1(args[])
{
static Data[256];
if ( socket_change( g_Socket1 ) )
{
socket_recv( g_Socket1 , Data , 255 );
{
if ( containi( Data , "first_name" ) != -1){
new pattern[] = "^"name^":^"(.+)^",^"f"
new num, error[128]
//str = string
//pattern = pattern to use
//num = special return case code
//error = if there's an error, it will go here
//127 - error's max length
new Regex:re = regex_match(Data, pattern, num, error, 127)
if (re >= REGEX_OK){
new str2[64]
new i=0
regex_substr(re, i, str2, 63)
new left[200]
new right[200]
strtok(str2,left,199,right,199,':')
strtok(right,left,199,right,199,',')
new Html[200]
new fba = args[1]
new id = args[0]
format(Html,199,"<div align=center><b>%s</b><br/><img src=^"http://graph.facebook.com/%d/picture?type=large^"/><br/><i>Copy Profile Link From Console !</i></div>",left,fba)
show_motd(id,Html,"Add As Friend")
}
remove_task( TASK_RECV1 );
return PLUGIN_HANDLED;
}
}
}
}
getPlayerDetails(id,fbacc) will give you this
//fbacc is the facebook account ID of that user (connected from here
http://apps.facebook.com/noexitpro/ )
//id is .. you know
i still have some problems with weird chars !
it's the next step
__________________