Skip to content

Instantly share code, notes, and snippets.

@hklcf
Created May 20, 2017 15:51
Show Gist options
  • Save hklcf/815734037c0dcc98ed422c20b0afa01c to your computer and use it in GitHub Desktop.
Save hklcf/815734037c0dcc98ed422c20b0afa01c to your computer and use it in GitHub Desktop.
<?php
/*
Version: 1.0
Copyright: supergag@HKEPC
Last Modified: 29/07/2015
*/
$ip = array(
'v.youku.com',
'app2.522.com.cn',
'b.scorecardresearch.com',
'comments.youku.com',
'e.stat.youku.com',
'g1.ykimg.com',
'g4.ykimg.com',
'g3.ykimg.com',
'h.irs01.com',
'k.youku.com',
'notify.youku.com',
'p-log.ykimg.com',
'p.l.youku.com',
'r1.ykimg.com',
'r2.ykimg.com',
'r3.ykimg.com',
'r4.ykimg.com',
'stat.youku.com',
'static.youku.com',
'swf.adtchrome.com',
'uo.youku.com',
'v.l.youku.com',
'yk.pp.navi.youku.com',
'ykrec.youku.com',
'youku.mycpis.com',
'yws.youku.com'
);
for($i = 0; $i <= 25; $i++) {
$content .= gethostbyname($ip[$i])." {$ip[$i]}\r\n";
}
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=hosts');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($content));
echo $content;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment