python监控virmach秒杀 import cfscrape import time import - Assbbs
python监控virmach秒杀 import cfscrape import time import json import re scraper = cfscrape.create scraper def check json input str : try: json.loads input str return True except: retur…
python监控virmach秒杀 import cfscrape import time import json import re scraper = cfscrape.create scraper def check json input str : try: json.loads input str return True except: return False i = 1 old data = 'Please only have one black friday page open at any given time, and if you are on a third party website ensure that you are not having it refreshed too often in the background' while i < 2 : time.sleep 1 web data = scraper.get "https://billing.virmach.com/modules/addons/blackfriday/new plan.json" .content if web data != old data : if check json web data : old data = web data data = json.loads web data if data 'windows' == 'FALSE' : windows = '不支持WINDOWS' else: windows = '支持WINDOWS' if 'ended' in data : print '当前秒杀已售罄' else: print '价格:$'+''.join re.findall r"\d+\.?\d ",data 'price' ,'内存:',data 'ram' ,'核心:',data 'cpu' ,'IP:',data 'ips' ,'硬盘:',data 'hdd' ,'流量:',data 'bw' ,'地区:',data 'location' ,windows print '购买链接:https://billing.virmach.com/cart.php?a=add&pid=' + str data 'pid' + '&billingcycle=annually'