0
0
mirror of https://git.fuwafuwa.moe/you/stop_cloudflare synced 2024-12-24 22:20:43 +01:00
stop_cloudflare/tool/get_fqdn_tmg1.php
2020-03-18 10:28:19 +00:00

25 lines
459 B
PHP

<?php
//License: WTFPL
define('F_INPUT','noncloudflarelist.txt');
define('F_OUTPUT','fqdnlist.txt');
if (!file_exists(F_INPUT)){
print 'File not found';
exit;
}
$result = array();
foreach(explode("\n",file_get_contents(F_INPUT)) as $t){
$t = explode(' ',$t)[0];
if (preg_match("/^([a-z0-9\.-]{1,255})\.([a-z]{2,40})$/",$t)){
$result[] = $t;
}
}
$result = array_unique($result);
file_put_contents(F_OUTPUT,implode("\n",$result));
print 'Done';