Skip to content

Commit e14325d

Browse files
authored
时间参数url编码 org 去重排列 新增 icpnumber
1 parent 4193553 commit e14325d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Hunter_view.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name Hunter view
33
// @namespace http://tampermonkey.net/
4-
// @version 0.4.4
4+
// @version 0.4.5
55
// @description Send the current website to Hunter
66
// @author 0cat
77
// @match http://*/*
@@ -75,6 +75,7 @@ function getNewDate(flag, many) {
7575
targetDate = targetDate.toString().padStart(2, '0')
7676
dealTargetDays = `${targetYear}-${targetMonth}-${targetDate}`
7777
dealDate = dealTargetDays+ " " + hh + ":" + mm + ":" + ss;
78+
dealDate = escape(dealDate)
7879

7980
return dealDate
8081
}
@@ -97,6 +98,10 @@ div.innerHTML = `<div style="font-size:14px;color:rgba(0,0,0,0.65);box-shadow: 0
9798
<div style="margin-right: 6px;white-space: nowrap">运营商和org:</div>
9899
<div class="org" style="word-wrap:break-word;word-break:normal;overflow: hidden;">null</div>
99100
</div>
101+
<div style="margin-bottom: 4px;display: flex">
102+
<div style="margin-right: 6px;white-space: nowrap">ICP:</div>
103+
<div class="icpnumber" style="word-wrap:break-word;word-break:normal;overflow: hidden;">null</div>
104+
</div>
100105
<div style="margin-bottom: 4px;display: flex">
101106
<div style="margin-right: 6px;white-space: nowrap">协议:</div>
102107
<div class="protocol" style="word-wrap:break-word;word-break:normal;overflow: hidden;">null</div>
@@ -151,7 +156,7 @@ body.appendChild(div)
151156
var HunterKey = GM_getValue("HunterKey");
152157
var url
153158
var search
154-
var Hunter_url = "https://hunter.qianxin.com/openApi/search?username="+ username + "&api-key=" + HunterKey + "&page=1&page_size=50&is_web=3&start_time=\"" + getNewDate("before", 6) + "\" &end_time=\""+ getNewDate() +"\"&search="
159+
var Hunter_url = "https://hunter.qianxin.com/openApi/search?username="+ username + "&api-key=" + HunterKey + "&page=1&page_size=50&is_web=3&start_time=" + getNewDate("before", 6) + "&end_time="+ getNewDate() + "&search="
155160
var target = window.location.hostname // 获取域名或者ip
156161
var isValidIP_reg=/(\d{1,3}\.){3}\d{1,3}/ //判断是否是ip还是domain
157162
var messaage = {}
@@ -185,6 +190,7 @@ body.appendChild(div)
185190
const protocol = document.getElementsByClassName('protocol')[0]
186191
const port = document.getElementsByClassName('port')[0]
187192
const surplus = document.getElementsByClassName('surplus')[0]
193+
const icpnumber = document.getElementsByClassName('icpnumber')[0]
188194

189195
const table_title = document.getElementsByClassName('table_title')[0]
190196
const table_protocol = document.getElementsByClassName('table_protocol')[0]
@@ -245,14 +251,18 @@ body.appendChild(div)
245251

246252
area.textContent = [target_location.country || '',target_location.province || '',target_location.city || ''].filter(item=>item).join('-') || ''
247253

248-
org.textContent = target_data[0].as_org || ''
254+
org.textContent = Array.from(new Set(target_data.filter(item=>item.as_org).map(item=>item.as_org))).join(',')
255+
256+
icpnumber.textContent = target_data[0].number || ''
257+
249258

250259
protocol.textContent = Array.from(new Set(target_data.filter(item=>item.protocol).map(item=>item.protocol))).join(',')
251260

252261
port.textContent = Array.from(new Set(target_data.filter(item=>item.port).map(item=>item.port))).join(',')
253262

254263
surplus.textContent = data.rest_quota.split(':')[1] || ''
255264

265+
256266
port.style.wordWrap = 'break-word'
257267
port.style.wordBreak = 'normal'
258268
port.style.overflow = 'hidden'

0 commit comments

Comments
 (0)