Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-05-2008, 12:01 AM   PM User | #1
mudoeb
New Coder

 
Join Date: Feb 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
mudoeb is an unknown quantity at this point
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 ?
mudoeb is offline   Reply With Quote
Old 06-05-2008, 01:41 PM   PM User | #2
derzok
Regular Coder

 
Join Date: May 2008
Location: Ohio
Posts: 231
Thanks: 3
Thanked 21 Times in 21 Posts
derzok is an unknown quantity at this point
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
derzok is offline   Reply With Quote
Old 06-05-2008, 02:41 PM   PM User | #3
mudoeb
New Coder

 
Join Date: Feb 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
mudoeb is an unknown quantity at this point
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
Quote:
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 ?
mudoeb is offline   Reply With Quote
Old 02-23-2009, 07:09 PM   PM User | #4
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,525
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
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.
jeddi is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:40 AM.


Advertisement
Log in to turn off these ads.