Ping PubSub from your WordPress or Moveable Type blog
If you like this post, please subscribe to our RSS feed to read our new posts every day.
Due to popular demand, here is the function to ping the PubSub RSS crawler from WordPress. (MT follows)
Add this function to your my-hacks.php:
// pings PubSub.com RSS Crawler
function pingPubSub($blog_ID = 1) {
// original function by Dries Buytaert for Drupal
global $blogname,$siteurl,$blogfilename;
if ((!(($blogname==”my weblog”) && ($siteurl==”http://example.com”) && ($blogfilename==”wp.php”))) && (!preg_match(”/localhost\//”,$siteurl))) {
$client = new xmlrpc_client(”/ping”, “xping.pubsub.com”, 80);
$message = new xmlrpcmsg(”weblogUpdates.ping”, array(new xmlrpcval($blogname), new xmlrpcval($siteurl.”/”.$blogfilename)));
$result = $client->send($message);
if (!$result || $result->faultCode()) {
return false;
}
return true;
} else {
return false;
}
}
Find these lines in your post.php (inside wp-admin folder) :
pingWeblogs($blog_ID);
pingBlogs($blog_ID);
And add this right after that:
pingPubSub($blog_ID);
All done and pingin (in WordPress)!
From Moveable Type:
From your main blog admin, click on Weblog config on the left hand column and then preferences on top (next to core setup).
Click on Publicity/Remote Interfaces/Trackback in the main list that shows on the page.
In the text area that follows, add this line:
http://xping.pubsub.com/ping
Thats it!












Comments RSS
Should that be pingPubSub instead of pingYahoo (in the post.php changes)?
[Reply]
Sherri (10 comments.) — 03/5/2004 @ 1:46 pmWhoops!!
Fixed! Thanks for the catch Sherri!
[Reply]
Mark — 03/5/2004 @ 1:48 pmI’m new to this, could you tell me why I would need this hack as opposed to just including the ping URI in my update services list on the options->writing page?
Sorry if this is a stupid question.
[Reply]
Dane (1 comments.) — 06/5/2005 @ 8:52 pm