sedif Posted February 18, 2011 Share Posted February 18, 2011 Guys i wrote one pinging script but i don't know it works or not... Someone help me about it works or not? <?php site1("http://site.com/sitemap.xml"); site2("http://site2.com/sitemap.xml"); function site1($url){ @file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url); @file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url); @file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url); @file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url); } Print "Pinging1 success"; function site2($url){ @file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url); @file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url); @file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url); @file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url); } Print "<br>Pinging2 success"; ?> Quote Link to comment Share on other sites More sharing options...
kickstart Posted February 18, 2011 Share Posted February 18, 2011 Hi That just appears to attempt to get responses from various search engines about a web site. However it is doing nothing with the responses and isn't even caring if there is an error. There are also 2 functions there that are (as best I can see) identical. The idea of functions is that you write one and call it passing different data. The 2nd function could be removed and the call for it just changed to use the first function instead. All the best Keith Quote Link to comment Share on other sites More sharing options...
sedif Posted February 18, 2011 Author Share Posted February 18, 2011 Thanks for response. So what should i do for the working regarding script? Can you help me brother... I want to simply clicking this automatically like using with web browser; http://www.google.com/webmasters/tools/ping?sitemap=http://site.com/sitemap.xml Regards. Quote Link to comment Share on other sites More sharing options...
kickstart Posted February 18, 2011 Share Posted February 18, 2011 Hi <?php site1("http://site.com/sitemap.xml"); site1("http://site2.com/sitemap.xml"); function site1($url){ @file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url); @file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url); @file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url); @file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url); } ?> <?php site1("http://site.com/sitemap.xml"); site1("http://site2.com/sitemap.xml"); function site1($url) { if( false == ($str=file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url))) echo "Could not contact server."; else echo "Returned data:<br /> $str"; if( false == ($str=file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url))) echo "Could not contact server."; else echo "Returned data:<br /> $str"; if( false == ($str=file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url))) echo "Could not contact server."; else echo "Returned data:<br /> $str"; if( false == ($str=file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url))) echo "Could not contact server."; else echo "Returned data:<br /> $str"; } ?> Remember than the returned pages could contain Javascript functions. All the best Keith Quote Link to comment Share on other sites More sharing options...
sedif Posted February 18, 2011 Author Share Posted February 18, 2011 Well thanks, i wrote that codes to notepad++, created *.php file and sended to host; http://jesusfuckingchrist.info/pingercode1.php <?php pinger("http://site.com/sitemap.xml"); pinger("http://site2.com/sitemap.xml"); function pinger($url){ @file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url); @file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url); @file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url); @file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url); } ?> http://jesusfuckingchrist.info/pingercode2.php <?php pinger("http://site.com/sitemap.xml"); pinger("http://site2.com/sitemap.xml"); function pinger($url) { if( false == ($str=file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url))) echo "Could not contact server."; else echo "Returned data:<br /> $str"; if( false == ($str=file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url))) echo "Could not contact server."; else echo "Returned data:<br /> $str"; if( false == ($str=file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url))) echo "Could not contact server."; else echo "Returned data:<br /> $str"; if( false == ($str=file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url))) echo "Could not contact server."; else echo "Returned data:<br /> $str"; } ?> Now, when i click to http://jesusfuckingchrist.info/pingercode1.php or pingercode2.php, site.com and site2.com will ping? Regards Quote Link to comment Share on other sites More sharing options...
kickstart Posted February 18, 2011 Share Posted February 18, 2011 Hi Should do, although not pinging as such. It is submitting things to those web sites. All the best Keith Quote Link to comment Share on other sites More sharing options...
sedif Posted February 18, 2011 Author Share Posted February 18, 2011 Understood, i used your second codes but it says "Could not contact server" Please see; http://jesusfuckingchrist.info/pingercode2.php Which one is clearly perfect for me? pingercode1 or pingercode2? Regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.