 |
boardom b2 message board
|
View previous topic :: View next topic |
Author |
Message |
bluviolin
Joined: 31 Dec 2003 Posts: 1 Location: Italy
|
Posted: Wed Dec 31, 2003 12:12 pm Post subject: Pinging Technorati |
|
|
This hack allows you to ping the Technorati aggregator when you update your weblog.
Insert this function in the b2-include/b2functions.php file or in an external included file:
Code: |
function pingTechnorati($blog_ID = 1)
{
global $use_technoratiping, $blogname,$siteurl,$blogfilename;
if ((!(($blogname=="my weblog") && ($siteurl=="http://example.com") && ($blogfilename=="b2.php"))) &&
(!preg_match("/localhost//",$siteurl)) && ($use_technoratiping))
{
$client = new xmlrpc_client("/rpc/ping", "rpc.technorati.com", 80);
$message = new xmlrpcmsg("weblogUpdates.ping", array(new xmlrpcval($blogname),
new xmlrpcval($siteurl."/")));
$result = $client->send($message);
if (!$result || $result->faultCode())
return(false);
return(true);
}
else
return(false);
}
|
Then, In the b2config.php file set the $use_technoratiping variable:
Code: | $use_technoratiping = 1; |
Finally, modify the 'post' case in the b2edit.php file:
Code: |
pingWeblogs($blog_ID);
pingCafelog($cafelogID, $post_title, $post_ID);
pingBlogs($blog_ID);
pingTechnorati($blog_ID); /* <--- ADD THIS LINE */
|
These instrucion are also available in the Technorati developers Wiki and, in Italian, on my Web site. |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1004 Location: Washington
|
Posted: Thu Jan 01, 2004 9:42 pm Post subject: |
|
|
Thanks for the function. I found an error, though.
The line...
Code: |
(!preg_match("/localhost//",$siteurl)) && ($use_technoratiping))
|
should be
Code: |
(!preg_match("/localhost/",$siteurl)) && ($use_technoratiping))
|
_________________ Michael P. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2 © 2001, 2002 phpBB Group
|