Commit 5afa42f0 by liuxiaoxing

test

parent 682a7d11
...@@ -38,8 +38,8 @@ ry_adplan_name = 'c测试1' ...@@ -38,8 +38,8 @@ ry_adplan_name = 'c测试1'
ry_adcreative_name = 'c测试1' ry_adcreative_name = 'c测试1'
# bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销 # bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销
pid = 'rryingxiao_int' pid = 'rryingxiao_int'
# URL = 'http://uri6.com/tkio/qABBvya?noredirect=true' # URL = 'http://uri6.com/tkio/JFFnQ3a?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/M73iIja?noredirect=true' URL = 'http://52.80.137.106:8083/tkio/JjiUJ3a?noredirect=true'
# 测试头条衍生事件回调时加上 # 测试头条衍生事件回调时加上
# callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D # callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D
...@@ -60,7 +60,7 @@ def computeMD5upper(message): ...@@ -60,7 +60,7 @@ def computeMD5upper(message):
return m.hexdigest().upper() return m.hexdigest().upper()
appkey = 'ee977614c940fc833f474d0696b852a0' appkey = 'b7c0146c5b14d7d6d87cfd9bf1853b3e'
lst = [] lst = []
nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
s = 0 s = 0
...@@ -69,7 +69,7 @@ for index in range(1): ...@@ -69,7 +69,7 @@ for index in range(1):
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')) # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
# 随机生成12为数组 # 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12)) # i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '884919303042' i = '044792973102'
o = ''.join(str(random.choice(range(10))) for _ in range(12)) o = ''.join(str(random.choice(range(10))) for _ in range(12))
m = ''.join(str(random.choice(range(10))) for _ in range(12)) m = ''.join(str(random.choice(range(10))) for _ in range(12))
se = ''.join(str(random.choice(range(10))) for _ in range(12)) se = ''.join(str(random.choice(range(10))) for _ in range(12))
...@@ -125,9 +125,12 @@ for index in range(1): ...@@ -125,9 +125,12 @@ for index in range(1):
# 'ry_adgroup_name': ry_adgroup_name, # 'ry_adgroup_name': ry_adgroup_name,
# 'ry_adplan_name': ry_adplan_name, # 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name': ry_adcreative_name, # 'ry_adcreative_name': ry_adcreative_name,
# 投放广告详情相关指标,以下四个指标相关联
# "ry_adgroup_id": ry_adgroup_id, # "ry_adgroup_id": ry_adgroup_id,
# "ry_adplan_id": ry_adplan_id, # "ry_adplan_id": ry_adplan_id,
# "ry_adcreative_id": ry_adcreative_id, # "ry_adcreative_id": ry_adcreative_id,
# # 账户id
# "accountid": accountid
# 'imei2': 'null', # 'imei2': 'null',
# 'meid': i # 'meid': i
# 'bd_vid': i # 'bd_vid': i
...@@ -165,7 +168,6 @@ for index in range(1): ...@@ -165,7 +168,6 @@ for index in range(1):
# '_carrier': '1', # '_carrier': '1',
# 'syscountryc': '1', # 'syscountryc': '1',
# 'sysrtime': '1', # 'sysrtime': '1',
# "accountid": accountid
} }
# timeout可以超时四秒 # timeout可以超时四秒
# verify = False # verify = False
......
...@@ -8,7 +8,7 @@ import hashlib ...@@ -8,7 +8,7 @@ import hashlib
#安卓常规渠道激活 #安卓常规渠道激活
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd' appkey = 'a57ba9d2c364a49f43f59cb33d96577e'
# 线上预约app # 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953 # 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd # 16dc0cb882d3dbec4f7f66251a84d6dd
...@@ -48,9 +48,9 @@ for index in range(1): ...@@ -48,9 +48,9 @@ for index in range(1):
# 60.13.148.23 新疆维吾尔自治区吐鲁番市 # 60.13.148.23 新疆维吾尔自治区吐鲁番市
# 61.139.239.255 广西壮族自治区北海市 # 61.139.239.255 广西壮族自治区北海市
# 119.60.0.0 宁夏回族自治区银川市 # 119.60.0.0 宁夏回族自治区银川市
# allEvent().installUpload(i, ip, appkey) allEvent().installUpload(i, ip, appkey)
# time.sleep(1) time.sleep(1)
# allEvent().startupEvent(i, ip, appkey) allEvent().startupEvent(i, ip, appkey)
# # time.sleep(1) # # time.sleep(1)
# allEvent().loginEvent(i, ip, appkey) # allEvent().loginEvent(i, ip, appkey)
# time.sleep(1) # time.sleep(1)
...@@ -61,8 +61,8 @@ for index in range(1): ...@@ -61,8 +61,8 @@ for index in range(1):
# time.sleep(1) # time.sleep(1)
# num = index + 1 # num = index + 1
# event = 'event_' + str(num) # event = 'event_' + str(num)
event = 'event_5' # # event = 'event_5'
allEvent().ziding_event(i, ip, appkey, event) # allEvent().ziding_event(i, ip, appkey, event)
# print(s) # print(s)
# s = int(s) + 1 # s = int(s) + 1
# time.sleep(3) # time.sleep(3)
......
...@@ -8,10 +8,10 @@ import time ...@@ -8,10 +8,10 @@ import time
#向短链发送点击数据 #向短链发送点击数据
#!!!!分包需要删掉https的s #!!!!分包需要删掉https的s
# URL = 'http://uri6.com/tkio/eeQfQza?noredirect=true&callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D' # URL = 'http://uri6.com/tkio/6RFjMra?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/rQrYJza?noredirect=true' URL = 'http://52.80.137.106:8083/tkio/6JZBBva?noredirect=true'
appkey = 'ee977614c940fc833f474d0696b852a0' appkey = 'a57ba9d2c364a49f43f59cb33d96577e'
# event = 'invoke' # event = 'invoke'
cmpaignid = '1111' cmpaignid = '1111'
# 广告创意ID # 广告创意ID
...@@ -33,7 +33,7 @@ for index in range(1): ...@@ -33,7 +33,7 @@ for index in range(1):
#随机生成12为数组 #随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(12)) # i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '548770268036' i = '845285910729'
#随机生成ip #随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '175.93.28.70' # ip = '175.93.28.70'
...@@ -78,13 +78,13 @@ for index in range(1): ...@@ -78,13 +78,13 @@ for index in range(1):
print('imei:', i) print('imei:', i)
print('ip', ip) print('ip', ip)
w = w+1 w = w+1
time.sleep(8) # time.sleep(8)
try: # try:
allEvent().installUpload(i, ip, appkey, cmpaignid) # allEvent().installUpload(i, ip, appkey, cmpaignid)
except Exception as err: # except Exception as err:
print('install_wrong:', w) # print('install_wrong:', w)
w = w + 1 # w = w + 1
print(err) # print(err)
# try: # try:
# allEvent().invoke_test(i, ip, appkey, cmpaignid) # allEvent().invoke_test(i, ip, appkey, cmpaignid)
# except Exception as err: # except Exception as err:
...@@ -98,16 +98,16 @@ for index in range(1): ...@@ -98,16 +98,16 @@ for index in range(1):
# print('注册_wrong:', w) # print('注册_wrong:', w)
# print(e) # print(e)
# # continue # # continue
time.sleep(2) time.sleep(8)
try: try:
allEvent().loginEvent(i, ip, appkey) allEvent().loginEvent(i, ip, appkey)
except Exception: except Exception:
print('登录_wrong:', w) print('登录_wrong:', w)
time.sleep(5) # time.sleep(5)
try: # try:
allEvent().payEvent(i, ip, appkey) # allEvent().payEvent(i, ip, appkey)
except Exception: # except Exception:
print('付费_wrong:', w) # print('付费_wrong:', w)
# num = index + 1 # num = index + 1
# event = 'event_' + str(num) # event = 'event_' + str(num)
# event = 'event_28' # event = 'event_28'
......
...@@ -150,7 +150,6 @@ class allEvent: ...@@ -150,7 +150,6 @@ class allEvent:
'_androidid': i, '_androidid': i,
'_ip': IP, '_ip': IP,
'_timestamp': current_time_13 '_timestamp': current_time_13
}, },
'when': when, 'when': when,
'ds': ds, 'ds': ds,
......
...@@ -5,7 +5,7 @@ import random ...@@ -5,7 +5,7 @@ import random
import time import time
import time import time
#安卓分包激活 #安卓分包激活
appkey = 'ee977614c940fc833f474d0696b852a0' appkey = 'a57ba9d2c364a49f43f59cb33d96577e'
#57ed2dd31596bb4682471e82c0c73c1a #57ed2dd31596bb4682471e82c0c73c1a
# 4b25b8a4dc584e63e9a7b81c3adedf2f # 4b25b8a4dc584e63e9a7b81c3adedf2f
# event = 'event_10' # event = 'event_10'
...@@ -13,21 +13,21 @@ appkey = 'ee977614c940fc833f474d0696b852a0' ...@@ -13,21 +13,21 @@ appkey = 'ee977614c940fc833f474d0696b852a0'
cmpaignid = '1111' cmpaignid = '1111'
for index in range(1): for index in range(1):
# 随机生成12为数组 # 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12)) # i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '691007221237' i = 'q27dux0c9d5mv9413cp903d07a8q1ipf'
# 随机生成ip # 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '143.205.125.236' # ip = '143.205.125.236'
# allEvent().installUpload(i, ip, appkey, cmpaignid) # allEvent().installUpload(i, ip, appkey, cmpaignid)
# time.sleep(3) # time.sleep(3)
allEvent().loginEvent(i, ip, appkey) # allEvent().loginEvent(i, ip, appkey)
# allEvent().orderEvent(i, ip, appkey) # allEvent().orderEvent(i, ip, appkey)
# time.sleep(1) # time.sleep(1)
# num = index + 1 # num = index + 1
# event = 'event_' + str(num) # event = 'event_' + str(num)
# allEvent().ziding_event(i, ip, appkey,event) # allEvent().ziding_event(i, ip, appkey,event)
# allEvent().payEvent(i, ip, appkey) allEvent().payEvent(i, ip, appkey)
# allEvent().registerEvent(i, ip, appkey) # allEvent().registerEvent(i, ip, appkey)
# allEvent().invoke_test(i, ip, appkey,cmpaignid) # allEvent().invoke_test(i, ip, appkey,cmpaignid)
print(i) print(i)
...@@ -17,16 +17,16 @@ event = 'exception' ...@@ -17,16 +17,16 @@ event = 'exception'
# # time.sleep(2) # # time.sleep(2)
# allevent().event_economy(i,appkey,c) # allevent().event_economy(i,appkey,c)
for _ in range(5): for _ in range(1):
i = ''.join(str(random.choice(range(10))) for _ in range(12)) i = ''.join(str(random.choice(range(10))) for _ in range(12))
c = ''.join(str(random.choice(range(10))) for _ in range(12)) c = ''.join(str(random.choice(range(10))) for _ in range(12))
allevent().event_install(i, appkey) allevent().event_install(i, appkey)
time.sleep(2) # time.sleep(2)
allevent().event_register(i, appkey) # allevent().event_register(i, appkey)
time.sleep(2) # time.sleep(2)
allevent().event_login(i, appkey) # allevent().event_login(i, appkey)
time.sleep(2) # time.sleep(2)
allevent().event_payment(i, appkey, c) # allevent().event_payment(i, appkey, c)
# time.sleep(2) # time.sleep(2)
# allevent().event_event(i,appkey,event) # allevent().event_event(i,appkey,event)
# allevent().event_economy(i,appkey,c) # allevent().event_economy(i,appkey,c)
......
...@@ -72,6 +72,7 @@ class allevent: ...@@ -72,6 +72,7 @@ class allevent:
}) })
p = requests.post(url=URL_install,data=s,headers=headers,timeout=4) p = requests.post(url=URL_install,data=s,headers=headers,timeout=4)
print(p.text) print(p.text)
print()
def event_startup(self,i,appid): def event_startup(self,i,appid):
s = json.dumps({ s = json.dumps({
"appid": appid, "appid": appid,
......
...@@ -1556,3 +1556,19 @@ def test_install(): ...@@ -1556,3 +1556,19 @@ def test_install():
receiveandroid.data[0]['device_info']['oaid'] = i receiveandroid.data[0]['device_info']['oaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid' receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
receiveandroid.send_request() receiveandroid.send_request()
def test_atbgoogle():
# i = idfacode()
i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750'
receiveandroid.data[0]['timestamp_info']['current_event_time'] = '1659148260199'
receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['imei1'] = ''
receiveandroid.data[0]['device_info']['gaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'gaid'
receiveandroid.data[0]['device_info']['os'] = '1'
receiveandroid.send_requestgoogle()
print(i)
\ No newline at end of file
...@@ -1713,6 +1713,7 @@ def test_impatb2(): ...@@ -1713,6 +1713,7 @@ def test_impatb2():
receiveios.send_request() receiveios.send_request()
print(i) print(i)
# 【新客获取展示精准归因开关】开,【新客获取展示概率IP+UA归因开关】开,【新客获取展示概率IP归因开关】开,传展示和激活数据(设备id,ua不同,ip相同),可ip归因 # 【新客获取展示精准归因开关】开,【新客获取展示概率IP+UA归因开关】开,【新客获取展示概率IP归因开关】开,传展示和激活数据(设备id,ua不同,ip相同),可ip归因
def test_impatb3(): def test_impatb3():
i = idfacode() i = idfacode()
...@@ -1770,6 +1771,7 @@ def test_impatb4(): ...@@ -1770,6 +1771,7 @@ def test_impatb4():
receiveios.send_request() receiveios.send_request()
print(i) print(i)
# 【新客获取展示精准归因开关】关,【新客获取展示概率IP+UA归因开关】开,【新客获取展示概率IP归因开关】关,传展示和激活数据(ip相同,ua不同),归因不上 # 【新客获取展示精准归因开关】关,【新客获取展示概率IP+UA归因开关】开,【新客获取展示概率IP归因开关】关,传展示和激活数据(ip相同,ua不同),归因不上
def test_impatb5(): def test_impatb5():
i = idfacode() i = idfacode()
...@@ -1798,6 +1800,7 @@ def test_impatb5(): ...@@ -1798,6 +1800,7 @@ def test_impatb5():
receiveios.send_request() receiveios.send_request()
print(i) print(i)
# ************************ip归因验证************************ # ************************ip归因验证************************
# 【新客获取展示精准归因开关】开,【新客获取展示概率IP+UA归因开关】关,【新客获取展示概率IP归因开关】开,传展示和激活数据(ip相同),归因上ip # 【新客获取展示精准归因开关】开,【新客获取展示概率IP+UA归因开关】关,【新客获取展示概率IP归因开关】开,传展示和激活数据(ip相同),归因上ip
def test_impatb6(): def test_impatb6():
...@@ -1827,6 +1830,7 @@ def test_impatb6(): ...@@ -1827,6 +1830,7 @@ def test_impatb6():
receiveios.send_request() receiveios.send_request()
print(i) print(i)
# 【新客获取展示精准归因开关】开,【新客获取展示概率IP+UA归因开关】关,【新客获取展示概率IP归因开关】开,传展示和激活数据(ip不相同),归因不上 # 【新客获取展示精准归因开关】开,【新客获取展示概率IP+UA归因开关】关,【新客获取展示概率IP归因开关】开,传展示和激活数据(ip不相同),归因不上
def test_impatb7(): def test_impatb7():
i = idfacode() i = idfacode()
...@@ -1886,9 +1890,6 @@ def test_impatb8(): ...@@ -1886,9 +1890,6 @@ def test_impatb8():
print(i) print(i)
# ************************【新客获取展示概率IP+UA归因回溯窗口期】验证************************ # ************************【新客获取展示概率IP+UA归因回溯窗口期】验证************************
# 【新客获取展示概率IP+UA归因回溯窗口期】设置15秒,发送展示,13秒后发送激活,可ip+ua归因 # 【新客获取展示概率IP+UA归因回溯窗口期】设置15秒,发送展示,13秒后发送激活,可ip+ua归因
# 【新客获取展示概率IP+UA归因回溯窗口期】设置15秒,发送展示,16秒后发送激活,归因不上 # 【新客获取展示概率IP+UA归因回溯窗口期】设置15秒,发送展示,16秒后发送激活,归因不上
...@@ -1920,3 +1921,132 @@ def test_impatb9(): ...@@ -1920,3 +1921,132 @@ def test_impatb9():
# 1.传一个激活,google自归因查询为true,2.last touch来自google渠道
# 归因为google,并通知google
# google归因
def test_atbgoogle():
# i = idfacode()
i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750'
v = idfvcode()
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['timestamp_info']['current_event_time'] = '1659148260199'
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.data[0]["event_info"]['event_name'] = 'install'
receiveios.send_requestgoogle()
print(i)
# 1.传一个激活,google自归因查询为true
# 2.有google渠道的点击
# 3.有cid=514的渠道下有点击(last touch)
# 归因为514渠道,并通知google
def test_atbgoogle2():
i2 = idfacode()
i = idfacode()
# i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750'
v = idfvcode()
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = computeMD5(i)
redirectios.parms['ts'] = '1656878232000'
redirectios.send_requestgoogle('')
time.sleep(5)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['timestamp_info']['current_event_time'] = '1659148260199'
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(i2)
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.send_requestgoogle()
print(i)
# asa激活
def test_atbgoogle3():
i = idfacode()
# i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750'
v = idfvcode()
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['timestamp_info']['current_event_time'] = '1659148260199'
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.data[0]['asa_info']['iad_info']['iad-attribution'] = 'true'
receiveios.data[0]['asa_info']['iad_info']['iad-org-id'] = '12345678901'
receiveios.data[0]['asa_info']['adservices_info']['token'] = ''
receiveios.send_requestgoogle()
print(i)
# 1.传一个激活,google自归因查询为true
# 2.模拟一条google点击
# 3.传一条头条展示
# (google点击的时间早于头条展示的时间)
# 归因到google
def test_atbgoogle4():
i2 = idfacode()
# i = idfacode()
i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750'
v = idfvcode()
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = computeMD5(i2)
redirectios.parms['touchpoint_type'] = 'impression'
redirectios.parms['ts'] = '1656878232000'
redirectios.send_requestgoogle('')
time.sleep(5)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['timestamp_info']['current_event_time'] = '1659148260199'
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i2)
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(i2)
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.send_requestgoogle()
print(i)
#激活中idfa为空
def test_atbgoogle5():
i2 = idfacode()
i = idfacode()
# i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750'
v = idfvcode()
# redirectios.parms['idfa'] = i
# redirectios.parms['idfa_md5'] = computeMD5(i2)
# redirectios.parms['ts'] = '1656878232000'
# redirectios.send_requestgoogle('')
# time.sleep(5)
receiveios.data[0]['device_info']['idfa'] = ''
receiveios.data[0]['timestamp_info']['current_event_time'] = '1659148260199'
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i2)
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = computeMD5(i2)
receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(i2)
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.send_requestgoogle()
print(i)
...@@ -48,7 +48,7 @@ data = [ ...@@ -48,7 +48,7 @@ data = [
"application_info": { "application_info": {
"appkey": "666", "appkey": "666",
"bundleid": "3423232", "bundleid": "3423232",
"app_version": "1.9.0", "app_version": "1",
"channel_name": "HUAWEI" "channel_name": "HUAWEI"
}, },
"timestamp_info": { "timestamp_info": {
...@@ -60,7 +60,7 @@ data = [ ...@@ -60,7 +60,7 @@ data = [
}, },
"collector_info": { "collector_info": {
"integration_type": "sdk", "integration_type": "sdk",
"collector_version": "1.8.4", "collector_version": "1.0.0",
"retried_times": "" "retried_times": ""
}, },
"device_info": { "device_info": {
...@@ -70,7 +70,7 @@ data = [ ...@@ -70,7 +70,7 @@ data = [
"device_id_md5": "8e488a40a17aed2f6752f51382a4eafc", "device_id_md5": "8e488a40a17aed2f6752f51382a4eafc",
"device_id_md5_type": "oaid_md5", "device_id_md5_type": "oaid_md5",
"os": "1", "os": "1",
"os_version": "19", "os_version": "unknow",
"manufacturer": "HUAWEI", "manufacturer": "HUAWEI",
"model": "Mate 40", "model": "Mate 40",
"ipv4": "1.1.1.1", "ipv4": "1.1.1.1",
...@@ -187,6 +187,26 @@ def send_requests2s(): ...@@ -187,6 +187,26 @@ def send_requests2s():
return response return response
def send_requestgoogle():
global data
# 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk'
# 测试
url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# 线上
# url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data))
print(response.text)
# 全局data
data = json.loads(data_temp)
response = json.loads(response.text)
s = str(response["status"])
response["status"] = s
return response
# 批量上报的数据中存在异常数据 # 批量上报的数据中存在异常数据
def test_piliang(): def test_piliang():
# data.append(data[0]) # data.append(data[0])
......
...@@ -44,7 +44,7 @@ data = [ ...@@ -44,7 +44,7 @@ data = [
"application_info": { "application_info": {
"appkey": "222", "appkey": "222",
"bundleid": "3423232", "bundleid": "3423232",
"app_version": "1.9.0", "app_version": "1",
"channel_name": "default" "channel_name": "default"
}, },
"timestamp_info": { "timestamp_info": {
...@@ -56,7 +56,7 @@ data = [ ...@@ -56,7 +56,7 @@ data = [
}, },
"collector_info": { "collector_info": {
"integration_type": "sdk", "integration_type": "sdk",
"collector_version": "1.8.4", "collector_version": "1.0.0",
"retried_times": "" "retried_times": ""
}, },
"device_info": { "device_info": {
...@@ -66,7 +66,7 @@ data = [ ...@@ -66,7 +66,7 @@ data = [
"device_id_md5": "c3381276ae145b3663c8e0f6dd9f628a", "device_id_md5": "c3381276ae145b3663c8e0f6dd9f628a",
"device_id_md5_type": "idfa_md5", "device_id_md5_type": "idfa_md5",
"os": "2", "os": "2",
"os_version": "19", "os_version": "unknown",
"manufacturer": "HUAWEI", "manufacturer": "HUAWEI",
"model": "Mate 40", "model": "Mate 40",
# "ipv4": "", # "ipv4": "",
...@@ -159,6 +159,8 @@ data = [ ...@@ -159,6 +159,8 @@ data = [
} }
} }
} }
] ]
data_temp = json.dumps(data) data_temp = json.dumps(data)
...@@ -168,9 +170,9 @@ def send_request(): ...@@ -168,9 +170,9 @@ def send_request():
# 对接se地址 # 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk' # url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk'
# 测试 # 测试
url = "http://tmtest.trackingio.com/receive/tkiov2/sdk" # url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# 线上 # 线上
# url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk" url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
data[0]['timestamp_info']['install_time'] = int(round(time.time() * 1000)) data[0]['timestamp_info']['install_time'] = int(round(time.time() * 1000))
data[0]['timestamp_info']['current_event_time'] = int(round(time.time() * 1000)) data[0]['timestamp_info']['current_event_time'] = int(round(time.time() * 1000))
...@@ -185,6 +187,28 @@ def send_request(): ...@@ -185,6 +187,28 @@ def send_request():
return response return response
def send_requestgoogle():
global data
# 对接se地址
# url = 'http://tmtest-se.trackingio.com/receive/tkiov2/sdk'
# 测试
# url = "http://tmtest.trackingio.com/receive/tkiov2/sdk"
# 线上
url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
data[0]['timestamp_info']['install_time'] = int(round(time.time() * 1000))
# data[0]['timestamp_info']['current_event_time'] = int(round(time.time() * 1000))
print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data))
print(response.text)
# 全局data
data = json.loads(data_temp)
response = json.loads(response.text)
s = str(response["status"])
response["status"] = s
return response
def send_request2(): def send_request2():
global data global data
url = "http://tkiomicro-receive-788931749.cn-north-1.elb.amazonaws.com.cn/receive/tkiov2/s2s" url = "http://tkiomicro-receive-788931749.cn-north-1.elb.amazonaws.com.cn/receive/tkiov2/s2s"
......
...@@ -130,7 +130,7 @@ def send_request2(): ...@@ -130,7 +130,7 @@ def send_request2():
def send_request3(cs): def send_request3(cs):
global parms global parms
# 测试 # 测试
url1 = 'http://tmtest.trackingio.com/receive/turl/ruUfUra' + cs url1 = 'http://tmtest.trackingio.com/receive/turl/M7vIrea' + cs
# 线上 # 线上
# url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/FFNn2aa' + cs # url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/FFNn2aa' + cs
parms['ts'] = int(round(time.time() * 1000)) parms['ts'] = int(round(time.time() * 1000))
......
...@@ -104,9 +104,9 @@ def send_request(cs): ...@@ -104,9 +104,9 @@ def send_request(cs):
def send_request3(cs): def send_request3(cs):
global parms global parms
# 测试 # 测试
url1 = 'http://tmtest.trackingio.com/receive/turl/JJvQFja' + cs # url1 = 'http://tmtest.trackingio.com/receive/turl/uaa6N3a' + cs
# 线上 # 线上
# url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/6Z3Yrya' + cs url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/6Z3Yrya' + cs
parms['ts'] = int(round(time.time() * 1000)) parms['ts'] = int(round(time.time() * 1000))
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url) print(response.url)
...@@ -115,7 +115,18 @@ def send_request3(cs): ...@@ -115,7 +115,18 @@ def send_request3(cs):
response = json.loads(response.text) response = json.loads(response.text)
return response return response
def send_requestgoogle(cs):
global parms
# 测试
# url1 = 'http://tmtest.trackingio.com/receive/turl/6BV73qa' + cs
# 线上
url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/6Z3Yrya' + cs
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url)
print(response.text)
parms = json.loads(data_temp)
response = json.loads(response.text)
return response
# idfa为空 # idfa为空
def test_idfa1(): def test_idfa1():
......
...@@ -617,37 +617,21 @@ def test_at6(): ...@@ -617,37 +617,21 @@ def test_at6():
def test_huiliu(): def test_huiliu():
# i = code_nums1(32) i = code_nums1(32)
i = 'jxmqw8bbpj706d812w6q67dfo5pf4428' # i = 'jxmqw8bbpj706d812w6q67dfo5pf4428'
oaid = code_nums1(15) oaid = code_nums1(15)
mac = code_nums1(32) mac = code_nums1(32)
androidid = code_nums1(16) androidid = code_nums1(16)
campaignid = '1111' campaignid = '3333'
campaignid2 = '3333'
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# clickandroid.parms['imei'] = i
# clickandroid.parms['imei_MD5'] = ''
# clickandroid.parms['oaid'] = oaid
# clickandroid.parms['androidid'] = androidid
# clickandroid.parms['mac'] = mac
# clickandroid.parms['ip'] = ip
# clickandroid.send_requestandroid('')
# time.sleep(8)
# tkioreceiveandroid.data['context']['_deviceid'] = i
# tkioreceiveandroid.data['context']['_imei'] = i
# tkioreceiveandroid.data['context']['_oaid'] = oaid
# tkioreceiveandroid.data['context']['_androidid'] = androidid
# tkioreceiveandroid.data['context']['_mac'] = mac
# tkioreceiveandroid.data['context']['_ip'] = ip
# tkioreceiveandroid.data['context']['_campaignid'] = campaignid
# tkioreceiveandroid.send_request()
# time.sleep(300)
clickandroid.parms['imei'] = i clickandroid.parms['imei'] = i
clickandroid.parms['imei_MD5'] = '' clickandroid.parms['imei_MD5'] = ''
clickandroid.parms['oaid'] = oaid clickandroid.parms['oaid'] = oaid
clickandroid.parms['androidid'] = androidid clickandroid.parms['androidid'] = androidid
clickandroid.parms['mac'] = mac clickandroid.parms['mac'] = mac
clickandroid.parms['ip'] = ip clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid2('') clickandroid.send_requestandroid('')
time.sleep(8) time.sleep(8)
tkioreceiveandroid.data['context']['_deviceid'] = i tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei'] = i tkioreceiveandroid.data['context']['_imei'] = i
...@@ -656,6 +640,23 @@ def test_huiliu(): ...@@ -656,6 +640,23 @@ def test_huiliu():
tkioreceiveandroid.data['context']['_mac'] = mac tkioreceiveandroid.data['context']['_mac'] = mac
tkioreceiveandroid.data['context']['_ip'] = ip tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.data['context']['_campaignid'] = campaignid tkioreceiveandroid.data['context']['_campaignid'] = campaignid
tkioreceiveandroid.send_request()
time.sleep(200)
clickandroid.parms['imei'] = i
clickandroid.parms['imei_MD5'] = ''
clickandroid.parms['oaid'] = oaid
clickandroid.parms['androidid'] = androidid
clickandroid.parms['mac'] = mac
clickandroid.parms['ip'] = ip
clickandroid.send_requestandroid2('')
time.sleep(8)
tkioreceiveandroid.data['context']['_deviceid'] = i
tkioreceiveandroid.data['context']['_imei'] = i
tkioreceiveandroid.data['context']['_oaid'] = oaid
tkioreceiveandroid.data['context']['_androidid'] = androidid
tkioreceiveandroid.data['context']['_mac'] = mac
tkioreceiveandroid.data['context']['_ip'] = ip
tkioreceiveandroid.data['context']['_campaignid'] = campaignid2
tkioreceiveandroid.data['what'] = "loggedin" tkioreceiveandroid.data['what'] = "loggedin"
tkioreceiveandroid.send_requestlogin() tkioreceiveandroid.send_requestlogin()
print(i) print(i)
......
...@@ -32,7 +32,7 @@ parms = { ...@@ -32,7 +32,7 @@ parms = {
def send_requestandroid(hc): def send_requestandroid(hc):
url1 = 'http://52.80.137.106:8083/tkio/rQrYJza?noredirect=true' + hc url1 = 'http://52.80.137.106:8083/tkio/BV3iyya?noredirect=true' + hc
# url1 = 'http://uri6.com/tkio/q6VFJva?noredirect=true' + hc # url1 = 'http://uri6.com/tkio/q6VFJva?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text) print(response.text)
...@@ -41,7 +41,7 @@ def send_requestandroid(hc): ...@@ -41,7 +41,7 @@ def send_requestandroid(hc):
def send_requestandroid2(hc): def send_requestandroid2(hc):
url1 = 'http://52.80.137.106:8083/tkio/uInu6ja?noredirect=true' + hc url1 = 'http://52.80.137.106:8083/tkio/YbIn6fa?noredirect=true' + hc
# url1 = 'http://uri6.com/tkio/q6VFJva?noredirect=true' + hc # url1 = 'http://uri6.com/tkio/q6VFJva?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text) print(response.text)
......
...@@ -8,7 +8,7 @@ import hashlib ...@@ -8,7 +8,7 @@ import hashlib
data = { data = {
"what": "install", "what": "install",
"appid": "ee977614c940fc833f474d0696b852a0", "appid": "a57ba9d2c364a49f43f59cb33d96577e",
"context": { "context": {
"_deviceid": "", "_deviceid": "",
"_imei": "", "_imei": "",
......
...@@ -2,11 +2,12 @@ from xiaochengxu.xiaochenxu_script import allEvent ...@@ -2,11 +2,12 @@ from xiaochengxu.xiaochenxu_script import allEvent
import socket import socket
import struct import struct
import random import random
appkey = '139ecfd40563dc846383de2b7f38ae7a' import time
appkey = '1cb67e8beb1fe0d5a9c000f6f05b58e5'
#cid #cid
cid = '21059' cid = '21059'
#surl #surl
surl = 'uMnEfqa' surl = 'nEJ77za'
for _ in range(1): for _ in range(1):
# 随机生成12为数组 # 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(28)) i = ''.join(str(random.choice(range(10))) for _ in range(28))
...@@ -16,7 +17,15 @@ for _ in range(1): ...@@ -16,7 +17,15 @@ for _ in range(1):
#打开 #打开
allEvent().openxiaochengxu(i,ip,cid,surl,appkey) allEvent().openxiaochengxu(i,ip,cid,surl,appkey)
time.sleep(5)
#pv #pv
# allEvent().pviaochengxu(i,ip,cid,surl,appkey) allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# #离开 # #离开
# allEvent().hidechengxu(i,ip,cid,surl,appkey) # allEvent().hidechengxu(i,ip,cid,surl,appkey)
allEvent().regedchengxu(i,ip,cid,surl,appkey)
# time.sleep(2)
# allEvent().loggedinchengxu(i,ip,cid,surl,appkey)
# time.sleep(2)
allEvent().paymentchengxu(i,ip,cid,surl,appkey)
time.sleep(2)
allEvent().eventchengxu(i,ip,cid,surl,appkey)
...@@ -4,35 +4,35 @@ import time ...@@ -4,35 +4,35 @@ import time
import random import random
headers = {'Content-Type': 'application/json'} headers = {'Content-Type': 'application/json'}
#测试环境 # 测试环境
# URL = 'http://10.2.20.42:8080/receive/tkio/event' URL = 'http://52.80.137.106:8080/receive/tkio/event'
# URL = 'http://10.2.20.42:8080/receive/tkio/'
#线上环境 # 线上环境
# URL = 'http://tlog.trackingio.com/receive/tkio/event' # URL = 'http://tlog.trackingio.com/receive/tkio/event'
URL = 'http://log.trackingio.com/receive/tkio/event' # URL = 'http://log.trackingio.com/receive/tkio/event'
#时间和日期 # 时间和日期
when = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())) when = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
#日期 # 日期
ds = time.strftime('%Y-%m-%d', time.localtime(time.time())) ds = time.strftime('%Y-%m-%d', time.localtime(time.time()))
#访问时常,以s计时 # 访问时常,以s计时
duration = '5' duration = '5'
#订单id # 订单id
transactionid = '34232323' transactionid = '34232323'
# 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay) # 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay)
paymenttype = 'alipay' paymenttype = 'alipay'
#货币类型 # 货币类型
currencytype = 'CNY' currencytype = 'CNY'
#支付金额 # 支付金额
currencyamount = '45' currencyamount = '45'
#是否热云默认,标记为自定义事件 # 是否热云默认,标记为自定义事件
isreyundefaultevent = '' isreyundefaultevent = ''
class allEvent: class allEvent:
#打开小程序 # 打开小程序
def openxiaochengxu(self,i,IP,cid,surl,appid): def openxiaochengxu(self, i, IP, cid, surl, appid):
s = json.dumps({ s = json.dumps({
"what": "launch", "what": "launch",
"appid": appid, "appid": appid,
...@@ -40,12 +40,15 @@ class allEvent: ...@@ -40,12 +40,15 @@ class allEvent:
"_cid": cid, "_cid": cid,
"_ip": IP, "_ip": IP,
"_deviceid": i, "_deviceid": i,
"_openid":i, "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_ry_adgroup_id": "111", "_ry_adgroup_id": "111",
"_ry_adplan_id": "111", "_ry_adplan_id": "111",
"_ry_adcreative_id": "111", "_ry_adcreative_id": "111",
# "advertiser_id": "aaa",
# "ad_id": "aaa",
# "creative_id": "aaa",
"_apptype": "wx" "_apptype": "wx"
}, },
"where": "launch", "where": "launch",
...@@ -59,6 +62,7 @@ class allEvent: ...@@ -59,6 +62,7 @@ class allEvent:
print(i) print(i)
# pv # pv
def pviaochengxu(self, i, IP, cid, surl, appid): def pviaochengxu(self, i, IP, cid, surl, appid):
s = json.dumps({ s = json.dumps({
"what": "pageview", "what": "pageview",
...@@ -67,7 +71,7 @@ class allEvent: ...@@ -67,7 +71,7 @@ class allEvent:
"_cid": cid, "_cid": cid,
"_ip": IP, "_ip": IP,
"_deviceid": i, "_deviceid": i,
"_openid": "xxxx", "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_apptype": "wx" "_apptype": "wx"
...@@ -89,12 +93,12 @@ class allEvent: ...@@ -89,12 +93,12 @@ class allEvent:
"_cid": cid, "_cid": cid,
"_ip": IP, "_ip": IP,
"_deviceid": i, "_deviceid": i,
"_openid": "xxxx", "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_apptype": "wx", "_apptype": "wx",
"_num_pages":"5", "_num_pages": "5",
"_duration":"10" "_duration": "10"
}, },
"where": "startup", "where": "startup",
"when": when, "when": when,
...@@ -103,3 +107,107 @@ class allEvent: ...@@ -103,3 +107,107 @@ class allEvent:
}) })
p = requests.post(url=URL, data=s, headers=headers, timeout=5) p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text) print(p.text)
# 注册
def regedchengxu(self, i, IP, cid, surl, appid):
s = json.dumps({
"what": "reged",
"appid": appid,
"context": {
"_cid": cid,
"_ip": IP,
"_deviceid": i,
"_openid": i,
"_campaignid": surl,
"_sceneid": "unknown",
"_apptype": "wx",
"_num_pages": "5",
"_duration": "10"
},
"where": "reged",
"when": when,
"ds": ds,
"who": "lxx-test"
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text)
# 付费
def paymentchengxu(self, i, IP, cid, surl, appid):
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({
"what": "payment",
"appid": appid,
"context": {
"_cid": cid,
"_ip": IP,
"_deviceid": i,
"_openid": i,
"_campaignid": surl,
"_sceneid": "unknown",
"_apptype": "wx",
"_num_pages": "5",
'_transactionid': transactionid,
'_paymenttype': paymenttype,
'_currencyamount': '90',
"_currencytype":currencytype,
"_duration": "10"
},
"where": "payment",
"when": when,
"ds": ds,
"who": "lxx-test"
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text)
# loggedin
def loggedinchengxu(self, i, IP, cid, surl, appid):
s = json.dumps({
"what": "loggedin",
"appid": appid,
"context": {
"_cid": cid,
"_ip": IP,
"_deviceid": i,
"_openid": i,
"_campaignid": surl,
"_sceneid": "unknown",
"_apptype": "wx",
"_num_pages": "5",
"_duration": "10"
},
"where": "loggedin",
"when": when,
"ds": ds,
"who": "lxx-test"
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text)
# 自定义事件
def eventchengxu(self, i, IP, cid, surl, appid):
s = json.dumps({
"what": "event_10",
"appid": appid,
"context": {
"_cid": cid,
"_ip": IP,
"_deviceid": i,
"_openid": i,
"_campaignid": surl,
"_sceneid": "unknown",
"_apptype": "wx",
"_num_pages": "5",
'_isreyundefaultevent': '1',
"_duration": "10"
},
"where": "event_10",
"when": when,
"ds": ds,
"who": "lxx-test"
})
p = requests.post(url=URL, data=s, headers=headers, timeout=5)
print(p.text)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment