<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[google in php]]></title><description><![CDATA[<p dir="auto">ciao a tutti, questo è una specie di motore di ricerca che funziona tramite google e salva i siti trovati in un txt. Ma vedo che è limitato..cioè non mi cerca molti siti come fa sul browser, si può modificare?</p>
<p dir="auto">&lt;?<br />
########################</p>
<h1>google v2.0</h1>
<h1>Versione in php</h1>
<p dir="auto">########################</p>
<p dir="auto">if (!empty($_GET['q']))<br />
{<br />
$hora = date("H:i:s"); $dia = date("m-d-y");<br />
$ip = $_SERVER['REMOTE_ADDR'];<br />
$SITEs = $ip.'-'.str_replace(":", "", $hora).str_replace("-", "", $dia).'.txt';</p>
<p dir="auto">echo "&lt;body onload="window.location='page.php?id=0&amp;sites={$SITEs}';"&gt;\n";<br />
echo "Attendere qualche minuto!&lt;br&gt;\n";<br />
@set_time_limit(0);</p>
<p dir="auto">function allstring($SITE) {<br />
$ALL[0] = parse_url($SITE);<br />
if (!empty($ALL[0]['query'])) {<br />
$ALL[1] = explode("=", $ALL[0]['query']);<br />
$ALL[2] = 1;<br />
$ALL[3] = '';<br />
$RESULTS = '';<br />
while ($ALL[2] &lt;= count($ALL[1])-1) {<br />
if (!empty($ALL[1][$ALL[2]])) {<br />
if (@eregi("&amp;", $ALL[1][$ALL[2]])) {<br />
$ALL[4] = explode("&amp;", $ALL[1][$ALL[2]]);<br />
$ALL[4] = $ALL[4][0];<br />
} else {<br />
$ALL[4] = $ALL[1][$ALL[2]];<br />
}<br />
$ALL[3] = str_replace($ALL[4], "[CMD]", $ALL[0]['query']);<br />
$RESULTS .= str_replace($ALL[0]['query'], $ALL[3], $SITE)."\n";<br />
}<br />
$ALL[2]++;<br />
}<br />
return $RESULTS;<br />
}<br />
}</p>
<p dir="auto">function filter($TEXT)<br />
{<br />
$CHAVE[1] = "&lt;a class=l href="";<br />
$CHAVE[2] = """;<br />
$SITE = explode($CHAVE[1], $TEXT);<br />
$cSITE = count($SITE)-1;<br />
$rSITES = '';<br />
for ($x = 1;$x &lt;= $cSITE;$x++)<br />
{<br />
$rSITE = explode($CHAVE[2], $SITE[$x]);<br />
$aSITE = str_replace("", "", $rSITE[0]);<br />
$rSITES .= allstring(strip_tags($aSITE));<br />
}<br />
return $rSITES;<br />
}<br />
function write($A, $B) {<br />
@touch($A);<br />
$C = fopen($A, 'a');<br />
fwrite($C, $B);<br />
fclose($C);<br />
}<br />
for ($n = 0;$n &lt; 900;$n+=10)<br />
{</p>
<p dir="auto">$URL = "<a href="http://www.google.com" rel="nofollow ugc">www.google.com</a>";<br />
$PORT = "80";<br />
$TIMEOUT = 30; // Padrão<br />
/* Não modifique isso */<br />
$Q = $_GET['q'];<br />
$GET = '/custom?q='.urlencode($Q).'+&amp;hl=en&amp;lr=&amp;ie=UTF-8&amp;cof=BGC:%23FFFFFF%3BT:%23000000%3BLC:%230000CC%3BVLC:%230000CC%3BALC:%230000CC%3BGALT:%23008000%3BGFNT:%23000000%3BGIMP:%23000000%3BDIV:%230000CC%3BLBGC:%23FFFFFF%3B&amp;start='.$n.'&amp;sa=N';<br />
$fp = fsockopen($URL, $PORT, $errno, $errstr, $TIMEOUT);</p>
<p dir="auto">if (!$fp)<br />
{<br />
echo "Errore nella connessione al sito {$URL}&lt;br&gt;\n";<br />
} else<br />
{<br />
$out = "GET $GET HTTP/1.1\r\n";<br />
$out .= "Host: $URL\r\n";<br />
$out .= "Connection: Close\r\n\r\n";<br />
fwrite($fp, $out);<br />
$buffer = '';<br />
while (!feof($fp))<br />
{<br />
$buffer .= fgets($fp, 128);<br />
}<br />
fclose($fp);<br />
write($SITEs, filter($buffer));</p>
<p dir="auto">}<br />
}<br />
} else<br />
{<br />
exit;<br />
}<br />
?&gt;</p>
]]></description><link>https://dev.connect.gt/topic/19380/google-in-php</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 12:25:05 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/19380.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Oct 2006 11:56:24 GMT</pubDate><ttl>60</ttl></channel></rss>