[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 05-11-2006, 06:36 AM   #1 (permalink)
col
NamePros Regular
 
col's Avatar
 
Join Date: Jan 2005
Location: Land of the m00
Posts: 723
140.10 NP$ (Donate)

col is just really nicecol is just really nicecol is just really nicecol is just really nice


Gathering stats from Google

I've done a little php script that is fetching some link stats from google. The script is working fine, but Google doesn't seem to like it... I'm getting the stats by parsing the page I get by file_get_contents() (PHP). After a while the script just didn't want to work and when I checked up on it I found that my automated searches returned a page looking like this: <link>
Anyone had the same problem? Any suggestions on alternative solutions?
__________________
The more I think
the more confused I get...
col is offline  
Old 05-11-2006, 06:54 AM   #2 (permalink)
 
BillyConnite's Avatar
 
Join Date: Jul 2005
Location: Coffs H, Australia
Posts: 3,107
47.00 NP$ (Donate)

BillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant futureBillyConnite has a brilliant future

Wildlife Parkinson's Disease Parkinson's Disease
I'd say that they have blocked your sites IP most likely, as it was probably against their TOS for you to be doing that .

They block a lot of PR predictors too, but most use various proxies to get the data from google now to spread the work, and lessen any risk of being banned.
__________________
<?php if(1===1){ $computer="fine."; }else{ $computer="broken."; } echo "Your computer is ".$computer; ?>
BillyConnite is offline  
Old 05-11-2006, 07:21 AM   #3 (permalink)
NamePros Regular
 
Noobie's Avatar
 
Join Date: Feb 2006
Location: Montreal, Quebec, Canada
Posts: 324
66.75 NP$ (Donate)

Noobie is on a distinguished road


Hi,

I got that error yesterday too out of the blue.
Had nothing to do with google stats, just visiting google to search for something.

I typed in the required characters and I haven't been asked since.
__________________
Goldkey.com is a scam
What's your BMI? | Timestamp Generator
Noobie is offline  
Old 05-11-2006, 10:05 AM   #4 (permalink)
col
NamePros Regular
 
col's Avatar
 
Join Date: Jan 2005
Location: Land of the m00
Posts: 723
140.10 NP$ (Donate)

col is just really nicecol is just really nicecol is just really nicecol is just really nice


Well, I guess I just have to skip their stats at the moment
__________________
The more I think
the more confused I get...
col is offline  
Old 05-11-2006, 01:58 PM   #5 (permalink)
NamePros Member
 
Join Date: Apr 2005
Posts: 116
134.00 NP$ (Donate)

mikesherov will become famous soon enoughmikesherov will become famous soon enough


Well, the way to do it is to build or use a proxy sniffer to get a list of valid proxies and just build a PHP function that uses proxies to fetch the information.

Well, I leave finding valid proxies a task left to the reader, but what kind of guy would I be if I didn't provide the function that works exactly like file_get_contents, but uses proxies?
PHP Code:
function proxy_url($server,$port,$proxy_url)
{
   
$proxy_name = $server;
   
$proxy_port = $port;
   
$proxy_cont = '';

   
$proxy_fp = fsockopen($proxy_name, $proxy_port);
   if (!
$proxy_fp)    {return false;}
   
fputs($proxy_fp, "GET $proxy_url HTTP/1.0\r\nHost: $proxy_name\r\n\r\n");
   while(!
feof($proxy_fp)) {$proxy_cont .= fread($proxy_fp,4096);}
   
fclose($proxy_fp);
   
$proxy_cont = substr($proxy_cont, strpos($proxy_cont,"\r\n\r\n")+4);
   return
$proxy_cont;
}
all you do is provide the proxy server name or ip address, the proxy port, and the the page you want to get.
mikesherov is offline  
Old 05-11-2006, 03:31 PM   #6 (permalink)
col
NamePros Regular
 
col's Avatar
 
Join Date: Jan 2005
Location: Land of the m00
Posts: 723
140.10 NP$ (Donate)

col is just really nicecol is just really nicecol is just really nicecol is just really nice


Quote:
Originally Posted by mikesherov
Well, the way to do it is to build or use a proxy sniffer to get a list of valid proxies and just build a PHP function that uses proxies to fetch the information.

Well, I leave finding valid proxies a task left to the reader, but what kind of guy would I be if I didn't provide the function that works exactly like file_get_contents, but uses proxies?
PHP Code:
function proxy_url($server,$port,$proxy_url)
{
   
$proxy_name = $server;
   
$proxy_port = $port;
   
$proxy_cont = '';

   
$proxy_fp = fsockopen($proxy_name, $proxy_port);
   if (!
$proxy_fp)    {return false;}
   
fputs($proxy_fp, "GET $proxy_url HTTP/1.0\r\nHost: $proxy_name\r\n\r\n");
   while(!
feof($proxy_fp)) {$proxy_cont .= fread($proxy_fp,4096);}
   
fclose($proxy_fp);
   
$proxy_cont = substr($proxy_cont, strpos($proxy_cont,"\r\n\r\n")+4);
   return
$proxy_cont;
}
all you do is provide the proxy server name or ip address, the proxy port, and the the page you want to get.
Thanks alot! Reputation added
__________________
The more I think
the more confused I get...
col is offline  
Old 05-12-2006, 12:45 PM   #7 (permalink)
NamePros Regular
 
Join Date: Mar 2006
Posts: 394
211.38 NP$ (Donate)

sacx13 is on a distinguished road


Caution

Use google api (registration and blah) if you don't have more than 1000 per day.

Regards
sacx13 is offline  
Old 05-12-2006, 03:52 PM   #8 (permalink)
Senior Member
 
Peter's Avatar
 
Join Date: Nov 2003
Location: Scotland
Posts: 4,900
0.60 NP$ (Donate)

Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute

Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
yes as sacx13 states use the api if you do not have too many queries. The problem with using proxies is that they will soon enough be blocked as well if too many requests get put in.

I have come across the page you get myself many times when searching manually on google.
Peter is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 11:37 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85