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