Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    php script to ping pingomatic.com

    i found php script to ping pingomatic

    PHP Code:
    <?php

    $content
    ='
    <?xmlversion="1.0"?>
    <methodCall>
    <methodName>weblogUpdates.extendedPing</methodName>
    <params>
    <param>
    <value>OfficialGoogleBlog</value>
    </param>
    <param>
    <value>http://googleblog.blogspot.com/</value>
    </param>
    <param>
    <value>http://googleblog.blogspot.com/changed-page.html</value>
    </param>
    <param>
    <value>http://googleblog.blogspot.com/atom.xml</value>
    </param>
    </params>
    </methodCall>
    '
    ;

    $headers='
    POST/HTTP/1.0
    User-Agent:MyBlog
    Host:rpc.pingomatic.com
    Content-Type:text/xml
    Content-length:
    '
    .strlen($content);

    $request=$headers."\r\n\r\n".$content;

    $fs=@fsockopen('rpc.pingomatic.com',80);
    if(
    $fs){
    fwrite($fs,$request);
    }

    ?>
    sometimes $headers have aтother values

    POST/RPC2HTTP/1.0
    User-Agent:request

    what is right ? or its not important ?

    script uses rpc.pingomatic.com adress without http:// - what about another variant http://rpc.pingomatic.com/rpc/ping ? what variant must be used ?

    IMPORTANT - how to get response from the server ? what procedures must be aded to the script ?

    ps - what address must be used to send pings to ipings.com ?

  • #2
    Regular Coder
    Join Date
    May 2008
    Location
    Ohio
    Posts
    231
    Thanks
    3
    Thanked 21 Times in 21 Posts
    I'd use the RPC. Wikipedia has a pretty decent article that explains the protocol: http://en.wikipedia.org/wiki/XML-RPC
    zok@zoklet:~$ whereis zok
    zok: http://zoklet.net | http://zoklet.net/otg | /derzok/at/gmail/dot/com

  • #3
    New Coder
    Join Date
    Feb 2008
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx for the link? but it's a basic theory

    a new code
    Code:
    <?php 
    
    $content = ' 
    <?xmlversion="1.0"?> 
    <methodCall> 
    <methodName>weblogUpdates.ping</methodName> 
    <params> 
    <param> 
    <value>OfficialGoogleBlog</value> 
    </param> 
    <param> 
    <value>http://googleblog.blogspot.com/</value> 
    </param> 
    <param> 
    <value>http://googleblog.blogspot.com/changed-page.html</value> 
    </param> 
    <param> 
    <value>http://googleblog.blogspot.com/atom.xml</value> 
    </param> 
    </params> 
    </methodCall> 
    '; 
    
    $headers = 'POST /RPC2 HTTP/1.0 
    User-Agent: Ping 
    Host: rpc.weblogs.com 
    Content-Type: text/xml 
    Content-length: '.strlen($content); 
    
    $request = $headers."\r\n".$content; 
    
    $fs = fsockopen('rpc.weblogs.com', 80, $error_number, $error_string); 
    
    if ($fs) 
    { 
    fwrite ($fs, $request); 
    
    while (!feof($fs)) 
    { 
    $response = fgets($fs); 
    echo $response; 
    } 
    
    fclose ($fs); 
    } 
    else 
    { 
    echo $error_number." - ".$error_string; 
    } 
    
    ?>
    if i send ping to rpc.weblogs.com i get
    HTTP/1.1 200 OK Date: Thu, 05 Jun 2008 08:52:07 GMT Server: Apache ...
    but if i send ping to rpc.pingomatic.com i have nothing

    if i send ping to blogsearch.google.com/ping/RPC2 or to ping.blogs.yandex.ru/RPC2 i have error 14006611

    what's wrong with the code ?

  • #4
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Did you ever sort out this pingomatic script ?

    I would like to use one fro my website.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •