const aff = 0
const like = 6
const new_plan =
'https://billing.virmach.com/modules/addons/blackfriday/new_plan.json'
const add = `https://virmach.com/manage/aff.php?aff=${aff}&pid=175`
Notification.requestPermission()
let pre = ''
const main = async () => {
let a = await fetch(new_plan)
a = await a.json()
cur = JSON.stringify(a)
console.log(cur)
if (pre === cur) {
return
}
pre = cur
a = parseFloat(a.price.match(/([\d\.]+)/)[1])
if (a < like) {
new Notification(a)
window.open(add)
}
}
main()
setInterval(main, 10000)
浏览器打开任意网站,F12打开控制台,粘贴运行
发表评论: