How to get roster from an existing connection

42 views
Skip to first unread message

Jason S

unread,
Jan 30, 2014, 1:00:42 AM1/30/14
to ja...@googlegroups.com
Here is my code:

$socket = "unix:///etc/JAXL/.jaxl/sock/jaxl_" . $pid . ".sock";
$fp = stream_socket_client( $socket, $errno, $errstr);
if (!$fp)
{
  display_error($errstr);
}
else
{
fwrite( $fp,'global \$client; \$client->get_roster(); print_r(\$client->roster);');
$response =  fread( $fp, 1024 );
printf( "$response\n" );
fclose( $fp );

exit;
}


I am getting a connection to the sock file, but a fwrite like that just returns b:0;.  What am I doing wrong?  Perhaps I'm not understanding what needs to be written.  I ultimately want $response to get the array roster.


I've spent countless hours trying to get JAXL to work and I'm almost there except for this last thing.  Thank you!
Message has been deleted

Jason S

unread,
Jan 31, 2014, 12:43:25 AM1/31/14
to ja...@googlegroups.com
Is this even possible the way I'm doing it?

If not, could I at least send a message this way?

JAXL is so powerful but it's a shame the documentation is lacking.  I plan to write a full guide to what I've done (a full Facebook server) if I can get it working.

Jason S

unread,
Jan 31, 2014, 10:43:32 PM1/31/14
to ja...@googlegroups.com
Was about to finally figure it out after another 10 hours.

I now have a complete server that will run the following:
mysite.com/?action=login&fb_app_id=(app id)&user=(user)&access_key(fb token)
mysite.com/?action=sendMessage&sid(session id)&to=(to fb ID)&msg=(message)

Everything is manged via PHP/MySQL and the processes are all cleaned up automatically as users become inactive.

Will be posting a guide/code when I get a chance.
Reply all
Reply to author
Forward
0 new messages