Ping Technorati using cURL and XMLRPC extensions.
1
2
3 $request = xmlrpc_encode_request("weblogUpdates.ping", array("Copenhagen Ruby Brigade", "http://copenhagenrb.dk/") );
4
5
6
7 $header[] = "Host: rpc.technorati.com";
8 $header[] = "Content-type: text/xml";
9 $header[] = "Content-length: ".strlen($request) . "\r\n";
10 $header[] = $request;
11
12 $ch = curl_init();
13 curl_setopt( $ch, CURLOPT_URL, "http://rpc.technorati.com/rpc/ping");
14 curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
15 curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
16 curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' );
17 $result = curl_exec( $ch );
18 curl_close($ch);
19
20 echo $result;