Do your own ping-er with php!

I started to use technorati not so much ago. One day I found the page to ping them. Ping? What's that ping thing? I started to look for some info but nothing quite clear at the beginning. Finally after doing some research, I discovered that it's a way to let know other server that you have new, updated content. To do that, you have to use some RPC = Remote Procedure Call, which belong to those famous techniques called Web Services. And in a raw manner, we could say it's based on exchanging messages in xml format between computers - you don't need a human to interact with a computer, somehow, now are the computers the ones which chat ;)

I didn't have any will to build an application or function in my blog to send or receive those xml messages. Luckily someone decided to let some clues around just in case one needed to do a custom pinging method. Concretely, in this page on Paddy works called Blog Pings you can find the almost perfect code needed for pinging technorati. But there's not any point in the blog entry where it says something essential: you will need a PEAR package installed, concretely the XML-RPC package. Once you get it, uninstall it and put in some accessible point for your script, for example, if your script for posting entries is called blog_post.php, put the PEAR XML-RPC code in a folder called XML which contains RPC.php, Server.php and Dump.php. Then from blog_post.php the require_once('XML/RPC.php') which appears in the sample code of Paddy Works will work.

If you get any error of not finding some PEAR function, you'll have to install the base code of PEAR, just in case your provider has not installed the base classes.