Using Zend_Http_Client to Ping Technorati

Send a ping to Technorati manually is a pain in the ass. Writing a little Method that handles this functionality for your own blog software is quite easy. Call the following method after you created or updated a post of yours:

private function _pingTechnorati()
    $xml = $this->view->render('ping_technorati.phtml');

    $httpclient = new Zend_Http_Client('');
            $httpclient->setHeaders('User-Agent', 'PHP/Zend Framework/Zend_Http');

    $httpclient->setRawData($xml, 'text/xml')->request('POST');

    $response = $httpclient->request();

    if($response->isSuccessful() === true) {
        return true;
    } else {
        return false;

You also need a little view in XML format like it is described in the Technorati Ping Configuration Guide and ready to go you are!

More about: ZendFramework

Sign up for my newsletter to get notified when I post new content on this blog and with the occasional exclusive content only for subscribers.

By clicking on the Subscribe button I am giving my consent for Benjamin Eberlei to hold my name and email address for the purposes of contacting me with a newsletter on the topics of this blog. You can unsubscribe with one click at any time and withdraw your consent. No spam. I will never share your e-mail address. Privacy Policy