Hi Guys,
I am trying to set up a script that pings (weblogUpdates.ping) feedburner at http://ping.feedburner.com/ when I post new content.
I have been looking at tutorials all day, and this is what I have come up with:
$method = "weblogUpdates.ping";
$params = array("MySiteName","url","url","none");
$request = xmlrpc_encode_request($method,$params);
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "Content-Type: text/xml",
'header' => "host: ping.feedburner.com",
'header' => "Content-Length: 250",
'content' => $request
)));
$file = file_get_contents("http://ping.feedburner.com", false, $context);
$response = xmlrpc_decode($file);
if (xmlrpc_is_fault($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
print_r($response);
}
I would like some advice as to whether or not this is the best way to go, will it even work, and if not, why not? What better ways are there? and so on.
When I try to run it it says: Call to undefined function xmlrpc_encode_request() in /home/writeabo/public_html/pingfeed.php on line 5
I guess this means my PHP doesn't have the xml-rpc enabled. Any ideas what I should ask of my host in the support email to get this sorted?
Thanks in advance.