Skip to content

Instantly share code, notes, and snippets.

@maicong
Created August 18, 2017 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maicong/97615ffabb7d6b4ccd4e33f7d7896374 to your computer and use it in GitHub Desktop.
Save maicong/97615ffabb7d6b4ccd4e33f7d7896374 to your computer and use it in GitHub Desktop.
;(async (...without) => {
let list = []
for (const n of Array.from({ length: 10 }, (v, i) => 1 + i)) {
await window
.fetch(`http://haoma.qq.com/json/act${n}.json.js`)
.then(r => r.text())
.then(r => JSON.parse(r.slice(16, -1)))
.then(r => r[2].map(v => list.push(v.num)))
}
list = [...new Set(list.sort())]
without = [...new Set(without)]
console.clear()
console.log('%c已找到的所有 8 位 QQ 号为:', 'font-weight: bold; color: red')
console.log(list.join(', ') || '暂无')
if (without.length) {
list = list.filter(v => !new RegExp(`(${without.join('|')})`).test(v))
console.log(
'%c其中不带 %s 的 QQ 号为:',
'font-weight: bold; color: red',
without.join('、')
)
console.log(list.join(', ') || '暂无')
}
})(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment