-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpost.php
79 lines (62 loc) · 1.68 KB
/
post.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
header("Content-type: text/html; charset=utf-8");
//http://item.taobao.com/item.htm?id=13152986793&wwdialog=bbxxbbmc
$url = "http://www.eaidc.com/ba.html";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
$arr_data = explode('<br />', $data);
array_shift($arr_data);
//http://item.taobao.com/item.htm?id=7627611524&wwdialog=bbxxbbmc 赵云18
$datatxt = '';
foreach (glob("yuming/*.txt") as $k=>$filename) {
$datatxt .= file_get_contents($filename);
}
$arr_tmp = preg_split("/[\s,]+|------/", $datatxt);
$alldata = array_merge($arr_data,$arr_tmp);
$alldata = array_unique($alldata);
$data=array();
foreach($alldata as $val){
if(strpos($val,'.net')===false&&strpos($val,'ICP')===false&&$val!=''){
$data[] = trim($val);
}
}
//sort($data);
usort($data,'cmp');
foreach($data as $val){
if(strlen($val)<=9&&strpos($val,"dy.")!==false){
$d[] = substr($val,0,-4);
}
}
sort($d);
echo "共:".count($d)."个域名可以供选择。<br>";
foreach($d as $val){
if(strlen($val)>9){exit;}
echo $val."<br>";
}
function cmp($a, $b)
{
if (strlen($a) == strlen($b)) {
return 0;
}
return (strlen($a) < strlen($b)) ? -1 : 1;
}
exit;
//冒泡排序
function buble_sort($arr){
$n = count($arr);
for($i=0;$i<$n;$i++){
for($j = $n-1;$j>$i;$j--){
if($arr[$j]<$arr[$j-1]){
$tmp = $arr[$j];
$arr[$j] = $arr[$j-1];
$arr[$j-1] = $tmp;
$flag = false;
}
}
}
return $arr;
}