summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorusername <user@n.ame>2019-05-07 10:09:35 +0000
committerusername <user@n.ame>2019-05-07 10:09:35 +0000
commit841bf5c7761cdb1fb7665204547e3b50da027c80 (patch)
tree6907d8ac35e6b21e8ec94d0681e0853014602137 /tool
parente940457f15976f91e68357ce7bf35eaeb4f86452 (diff)
downloadcloudflare-tor-841bf5c7761cdb1fb7665204547e3b50da027c80.tar
cloudflare-tor-841bf5c7761cdb1fb7665204547e3b50da027c80.tar.gz
cloudflare-tor-841bf5c7761cdb1fb7665204547e3b50da027c80.tar.lz
cloudflare-tor-841bf5c7761cdb1fb7665204547e3b50da027c80.tar.xz
cloudflare-tor-841bf5c7761cdb1fb7665204547e3b50da027c80.zip
Upload files to 'tool'
Diffstat (limited to 'tool')
-rw-r--r--tool/get_fqdn_tmg1.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tool/get_fqdn_tmg1.php b/tool/get_fqdn_tmg1.php
new file mode 100644
index 00000000..04e65b57
--- /dev/null
+++ b/tool/get_fqdn_tmg1.php
@@ -0,0 +1,23 @@
+<?php
+//License: WTFPL
+
+define('F_INPUT','noncloudflarelist.txt');
+define('F_OUTPUT','fqdnlist.txt');
+
+if (!file_exists(F_INPUT)){
+ die('File not found');
+}
+
+$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));
+
+echo('Done');