function testNET_PRC_RPCClient() { $rpc = new RPCClient("http://www.livejournal.com/interface/xmlrpc"); $result = $rpc->__call("LJ.XMLRPC.getfriends", array("username" => "username", "password" => "password", "ver" => 1)); $this->assertTrue($result['friends'], "Invalid success response"); $result = $rpc->__call("exec", array()); $this->assertTrue($result['faultString'], "Invalid fault response"); }
/** * Get friends list from LiveJournal account * * @return array array of friends where item in format * ('username' => , 'fullname' => ) */ function GetFriendsList() { $rpc = new RPCClient(self::RPC_URL); $result = $rpc->__call("LJ.XMLRPC.getfriends", array( "username" => $this->AccountID, "password" => $this->Password, "ver" => 1 )); foreach($result['friends'] as $k => &$friend) { if (is_object($friend['fullname']) && $friend['fullname']->xmlrpc_type == 'base64') $result['friends'][$k]['fullname'] = $friend['username']; } return $result['friends']; }