Forums

How to ping to other directories? (3 posts)

  1. franpereiro
    Member
    Posted 9 years ago #

    I have the following information:
    URL Ping: http://bitacoras.net/ping/
    Port: 80
    I tried using the same weblogs.com function, since on bitacoras.net they say, in their instructions manual, that the pinging to their site is similar to weblogs.com; so, having said that, this is the function I've been trying to use with no success:
    functions.php, within the wp-includes folder:
    // pings Bitacoras.net
    function ping_bitasnet($blog_ID = 1) {
    // original function by Dries Buytaert for Drupal
    global $use_weblogsping, $blogname,$siteurl,$blogfilename;
    if ((!(($blogname=="FrankPereiro") && ($siteurl=="http://frankpereiro.bitacoras.com") && ($blogfilename=="wp.php"))) && (!preg_match("/localhost\//",$siteurl)) && ($use_weblogsping)) {
    $client = new xmlrpc_client("", "bitacoras.net/ping/", 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;
    }
    }
    And then I have this code in the post.php file within the wp-admin folder:
    ping_bitasnet($blog_ID);
    pingWeblogs($blog_ID);
    pingBlogs($blog_ID);
    I have successfully inserted a code to ping to another blog directory by using this:
    in the functions.php within the wp-includes folder:
    function ping_meu($servidor,$dir,$port)
    { $f=new xmlrpcmsg('weblogUpdates.ping',array(new xmlrpcval("frankpereiro"),new xmlrpcval("http://frankpereiro.bitacoras.com")));
    $c=new xmlrpc_client($dir, $servidor, $port);
    $c->setDebug(0);
    $r=$c->send($f);
    }
    and the I inserted the next code within the post.php file in the wp-admin folder:
    ping_meu("ping.bitacoras.com","/",80);
    -------------------------------------------
    I've tried using both codes but it doesn't work for bitacoras.net. My blog doesn't show in the "updated list", thus, I have to ping manually.
    Maybe someone could help me out on this issue. I will really, really, appreciate some help. Thanks in advance.
    Greetings,

  2. Laughinglizard
    Member
    Posted 9 years ago #

    Try this:
    Insert this into my-hacks.php (or functions.php):
    // pings bitacoras.net
    function pingbitacoras($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", "bitacoras.net", 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;
    }
    }
    And add this to your post.php:
    pingbitacoras($blog_ID);

  3. franpereiro
    Member
    Posted 9 years ago #

    Hi eescarez,
    In fact, the three sites are different, bitacoras.com, bitacoras.net and the newest of the 3: bitacoras.org
    By the way LaughingLizard, I have tried many different ways for pinging to bitacoras.net but it's not pinging. What I'm going to do is send them an email and see if they reply with an answer on how to ping to their site. Thanks a lot.
    Greetings,

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.