post-page

Ping PubSub from your WordPress or Moveable Type blog

3
responses
by
 
on
February 10th, 2004
in
WordPress Hack

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!

heading
heading
3
Responses

 

Comments

  1. Sherri (10 comments.) says:

    Should that be pingPubSub instead of pingYahoo (in the post.php changes)?

  2. Mark says:

    Whoops!!
    Fixed! Thanks for the catch Sherri!

  3. Dane (1 comments.) says:

    I’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.



Obviously Powered by WordPress. © 2003-2013

page counter
css.php