Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($data=file_get_contents('https://lists.blocklist.de/lists/all.txt')){
- $i=preg_match_all('/\d+\.\d+\.\d+\.\d+/',$data,$matches);
- echo "<pre>";
- print($i);
- // var_dump($matches[0]);
- $a=array_map('ip2long',$matches[0]);
- $a=array_unique($a,SORT_NUMERIC);
- sort($a);
- //print_r(array_map('long2ip',$a));
- $result = array_map(function ($ip) {
- return "($ip,'".long2ip($ip)."','" . str_pad(base_convert($ip, 10,36), 7, '0',STR_PAD_LEFT ) .".blocklist.de','2019-11-11')" ;
- }, $a);
- // print_r($result);
- $sql='replace into rdns2(i,ip,x,ts) values ' . implode(', ',$result);
- print $sql . "\n";
- echo "</pre>";
- };
- ?>
Add Comment
Please, Sign In to add comment