There was another thread talking about how to target adword ads to specific sites.
Now here is a bit of code.
I know it is an ugly bitch, but I have no time to play with it any more right now.
You need: PHP and curl.
What it does? Well, it searches for the string in $query and gets the first 5 pages from Google. Then it crawls those results to see if adsense is installed. It then gives you the links for those sites.
I know it needs an input box, the variable names are shitty, etc, etc... blablabla...
As I said, no time right now.
Take it and play with it.
::emp::
Now here is a bit of code.
I know it is an ugly bitch, but I have no time to play with it any more right now.
You need: PHP and curl.
Code:
<h2>Google Ad Crawl</h2>
<?php
$GooglePrefix = "http://www.google.com/search?q=";
$GoogleCountSuffix ="&start=";
$query ="car repair";
$loop = 0;
echo "Looking for ".$query."<br>";
while ($loop<= 50)
{
$CompleteUrl = $GooglePrefix.$query.$GoogleCountSuffix.$loop;
$res = $res.webFetcher($CompleteUrl);
$loop = $loop+10;
}
echo "<hr>";
$regx = do_reg($res, "/h2.class=r.*(http.*)\"/U");
/* Now we want to fetch all those URLs*/
for ($i = 0; $i < count($regx); $i++)
{
$text = $regx[$i];
$comp = webFetcher($text);
if (preg_match("/google_ad/", $comp, $matches))
{
echo "Google ad code found! <a href=".$text.">".$text."</a><br>";
}
}
function do_reg($text, $regex)
{
preg_match_all($regex, $text, $regxresult, PREG_PATTERN_ORDER);
return $regresult = $regxresult[1];
}
function webFetcher($url)
{
/* This does exactly what it is named after - it fetches a page from the web, just give it the URL */
$crawl = curl_init();
curl_setopt ($crawl, CURLOPT_URL, $url);
curl_setopt($crawl, CURLOPT_RETURNTRANSFER, 1);
$resulting = $resulting.curl_exec($crawl);
curl_close($crawl);
return $result = $resulting;
}
?>
I know it needs an input box, the variable names are shitty, etc, etc... blablabla...
As I said, no time right now.
Take it and play with it.
::emp::