-
Notifications
You must be signed in to change notification settings - Fork 12
/
sindicePing.php
36 lines (28 loc) · 946 Bytes
/
sindicePing.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<!-- Taken from http://sindice.com/developers/pingApi -->
<?php
function doPing($title, $URI) {
include("include/xmlrpc.inc");
$client = new xmlrpc_client("http://sindice.com/xmlrpc/api");
$payload = new xmlrpcmsg("weblogUpdates.ping");
$payload->addParam(new xmlrpcval($title));
$payload->addParam(new xmlrpcval($URI));
$response = $client->send($payload);
$xmlresponsestr = $response->serialize();
$xml = simplexml_load_string($xmlresponsestr);
$result = $xml->xpath("//value/boolean/text()");
if($result) {
if($result[0] == "0"){
// echo "<p>Submitting $URI to $servicetitle succeeded.</p>";
return;
}
}
else {
$err = "Error Code: "
.$response->faultCode()
."<br /> Error Message: "
.$response->faultString();
// echo "<p>Failed to submit $URI to $servicetitle.</p>";
}
}
?>