Hi Guys,
I had made a script to use google search service to estimate how possible a website having p0rn contents. And just thought to share it with you.
PHP Code:
function send_query($url,$safe='active') { $res=strip_tags(file_get_contents('http://www.google.com/search?q=' . urlencode('site:' . $url) . '&safe=' . $safe)); preg_match('/Results 1 - [0-9]+ of (about)? ([0-9]+(,[0-9]{3})*) from/i',$res,$matches);
return str_replace(',','',$matches[2]); }
function get_info($url) { if(strpos($url,'http://')!==false) $url=parse_url($url,PHP_URL_HOST);//extract domain
$info['safe_pages']=send_query($url); $info['all_pages']=send_query($url,'off');
if(empty($info['all_pages'])) $info['prating']=-1;
else $info['prating']=round(10*$info['safe_pages']/$info['all_pages'],2);
return $info; } print_r(get_info($_GET['url']));
To use this code simply copy and past it into an empty file say 'check_url.php'
then upload that file to your website and open it like that
Code:
check_url.php?url=domain.com
You will get a value called prating.
From my observation you can use this value to guess the following results
- prating = -1 unknown (website not listed or blocked by google).
- 0 <= prating < 1 this is a p0rn site.
- 1 <= prating < 4 probably this is not p0rn site but friendly toward p0rn.
- 4 <= prating < 8 it doesn't allow p0rn but can be indirectly linking in some way to sites that allow or support p0rn.
- 8<= prating < 10 this website is very safe for general audience.
Note: Please use that script for personal use only and be careful not to overuse it in a short time or google may block your ip.
Hoping it will be useful 
|