"; foreach ($posts as $post) { $post_content .= "
  • ".$post['attributes']['DESCRIPTION']."
  • "; if (isset($post['attributes']['EXTENDED'])) $post_content .= "

    ".$post['attributes']['EXTENDED']."

    "; } $post_content .= ""; } else { //no bookmarks for today $post_content .= "Sorry, but I didn't save any bookmarks to del.icio.us today."; } //create the xml-rpc client object $client = new xmlrpc_client(WP_XMLRPC_URL,WP_XMLRPC_HOST,80); //create an array for our post data $post = array(); $post['title' ]= "del.icio.us links for today"; $post['description'] = $post_content; //assemble the xml-rpc message $paramaters = array( php_xmlrpc_encode("1"), php_xmlrpc_encode(WP_USERNAME), php_xmlrpc_encode(WP_PASSWORD), php_xmlrpc_encode($post), php_xmlrpc_encode("1") ); $message = new xmlrpcmsg("metaWeblog.newPost",$paramaters); //what do we want our response to be? $client->return_type = 'phpvals'; //send the XML-RPC message to the server $response = $client->send($message); //check the response to make sure all went well if ($response->errstr != '') $log .= " XML-RPC CALL FAILED - ".$response->errstr; else $log .= " success"; } else { $log .= " DEL.ICIO.US API CALL FAILED - status code was ".$api_return['status']; } //output log to screen echo $log; ?>