Implementing Pingers

If you are interested in pinging one of the many blog pinger/update sites, you might want to consider Ping-O-Matic.  If you ping them them, they will in turn ping several services by default for you:
  • Weblogs.com
  • Blo.gs
  • Technorati
  • MyYahoo! (currently disabled)
  • BlogRolling
  • BlogChatter
  • PubSub
If you use blogging software that allows you to enter a ping URL, it's real easy.  Just add https://rpc.pingomatic.com/ to your configuration.  If you use a lesser known blogging package (*cough* PolarBlog *cough*) you may need to add it yourself or run a separate script to do the pinging for you.  I'm implementing this in PolarBlog with an option to turn it off and on using code similar to the following test code:

//--- Includes
require('XmlRpc_class.php');

define("XMLRPC_DEBUG", 1); //debugging only!!!

$method = 'weblogUpdates.ping';
$blog_name = 'PolarLava';
$blog_url = 'https://www.polarlava.com/blog/';
$site = 'rpc.pingomatic.com';
$location = '/RPC2';

$params = array(XMLRPC_prepare($blog_name),XMLRPC_prepare($blog_url));
list($stat, $result) = XMLRPC_request( $site, $location, $method, $params );
echo "STAT: $stat<br/>";
foreach ($result as $key => $value) {
  echo(" $key => $value " . '<br/>');
}


When run, this will (hopefully) return the following:
  STAT: 1
  flerror =>
  message => Pings being forwarded to 7 services!
Which indicates that this was successful.

Now before you can use this you need to grab Keith Devens' XML-RPC Library and save that in a separate include file.  That's what is really doing the heavy lifting here.

Hopefully this might be of use to you if you've been trying to figure out how to implement a pinger.  Confession time…this entry is basically a reworking of a Simple way to Ping using PHP and XML-RPC.  That's basically where all of the information you are reading here came from.  Thanks, Kris.
October 15, 2004 @ 07:36 am | Category:
comments powered by Disqus