forked from chendayin/taobao_spider
-
Notifications
You must be signed in to change notification settings - Fork 1
/
brush_digNum.py
32 lines (25 loc) · 860 Bytes
/
brush_digNum.py
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
import json
from root_api import gw_api, get_curr_user, UC_SERVER
import time
from get_taobao_timestamp import get_timestamp
def brush_pv_root(topic):
while 1:
user = get_curr_user(UC_SERVER)
uid = user['result']['uid']
sid = user['result']['sid']
data = json.dumps(
{"bizCode": 1, "bizTag": "ubee", "offset": "0", "pagesize": "8", "role": "5",
"sdkversion": "0.3.0",
"timestamp": get_timestamp(), "topic": topic})
v = "1.0"
api = "mtop.taobao.powermsg.msg.pullnativemsg"
host = "guide-acs.m.taobao.com"
text = gw_api(api, v, data, host)
print(text)
def main():
topic = "f81ea59d-d559-430d-8e93-6b793749aef3"
brush_pv_root(topic)
if __name__ == '__main__':
t = time.time()
main()
print(f"cost time {time.time() - t}s")