Commit 76ac8f9e by liuxiaoxing

test

parent f5dc8483
...@@ -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://52.80.137.106:8083/tkio/euAVfua?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/q6VFJva?noredirect=true'
URL = 'http://uri6.com/tkio/a6ZVNba?noredirect=true' # URL = 'http://52.80.137.106:8083/tkio/rQVVRna?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 = '16dc0cb882d3dbec4f7f66251a84d6dd' appkey = '8a390227254c03dbcaddbca009cd6e8b'
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
...@@ -134,11 +134,14 @@ for index in range(1): ...@@ -134,11 +134,14 @@ for index in range(1):
# 'oaid': "9f80c84a559f573636a47ff8daed0d32", # 'oaid': "9f80c84a559f573636a47ff8daed0d32",
# 'muid': "4C63905D9694B9BF8D3EE38E64809A73", # 'muid': "4C63905D9694B9BF8D3EE38E64809A73",
# 'mac': "5432453241421", # 'mac': "5432453241421",
# 'subchannel': '333', # 子渠道
# 'aid': '111', 'subchannel': '2000',
# 'siteid': '222', # 计划
'aid': '888',
# 广告位
'siteid': '777',
# 流量来源 # 流量来源
# 'csite': '40006', 'csite': '666',
# "timestamp": "1569141628027", # "timestamp": "1569141628027",
# "creative": "31096865315", # "creative": "31096865315",
# "deviceid": 'null', # "deviceid": 'null',
...@@ -162,7 +165,7 @@ for index in range(1): ...@@ -162,7 +165,7 @@ for index in range(1):
# '_carrier': '1', # '_carrier': '1',
# 'syscountryc': '1', # 'syscountryc': '1',
# 'sysrtime': '1', # 'sysrtime': '1',
"accountid": accountid # "accountid": accountid
} }
# timeout可以超时四秒 # timeout可以超时四秒
# verify = False # verify = False
...@@ -190,7 +193,7 @@ for index in range(1): ...@@ -190,7 +193,7 @@ for index in range(1):
# print('androidid', a) # print('androidid', a)
w = w + 1 w = w + 1
time.sleep(10) time.sleep(8)
try: try:
allEvent().installUpload(i, ip, appkey) allEvent().installUpload(i, ip, appkey)
# allEvent().formevent(i, ip, appkey) # allEvent().formevent(i, ip, appkey)
...@@ -198,8 +201,8 @@ for index in range(1): ...@@ -198,8 +201,8 @@ for index in range(1):
except Exception: except Exception:
print('install_wrong:', w) print('install_wrong:', w)
w = w + 1 w = w + 1
# # # # #
# # # # #
# time.sleep(5) # time.sleep(5)
# try: # try:
# allEvent().registerEvent(i, ip, appkey) # allEvent().registerEvent(i, ip, appkey)
...@@ -274,14 +277,14 @@ for index in range(1): ...@@ -274,14 +277,14 @@ for index in range(1):
# num = index + 1 # num = index + 1
# event = 'event_' + str(num) # event = 'event_' + str(num)
event = 'event_30' # event = 'event_30'
time.sleep(3) # time.sleep(3)
try: # try:
allEvent().ziding_event(i, ip, appkey, event) # allEvent().ziding_event(i, ip, appkey, event)
print(event) # print(event)
except Exception as err: # except Exception as err:
print(err) # print(err)
print('自定义_wrong:', w) # print('自定义_wrong:', w)
# time.sleep(6) # time.sleep(6)
# try: # try:
......
...@@ -7,8 +7,8 @@ headers = {'Content-Type': 'application/json', 'X-RY-Access-Token': 'test_access ...@@ -7,8 +7,8 @@ headers = {'Content-Type': 'application/json', 'X-RY-Access-Token': 'test_access
# 测试环境 # 测试环境
URL_batch = 'http://10.3.20.42:8080/receive/batch' URL_batch = 'http://10.3.20.42:8080/receive/batch'
URL = 'http://52.80.137.106:8080/receive/tkio/' # URL = 'http://52.80.137.106:8080/receive/tkio/'
# URL = 'http://log.trackingio.com/receive/tkio/' URL = 'http://log.trackingio.com/receive/tkio/'
# URL = 'http://jisulog.sortda.com/receive/tkio/' # URL = 'http://jisulog.sortda.com/receive/tkio/'
# URL = 'http://172.31.21.207:8080/receive/tkio/' # URL = 'http://172.31.21.207:8080/receive/tkio/'
# URL = 'http://120.53.212.71/receive/tkio/' # URL = 'http://120.53.212.71/receive/tkio/'
...@@ -77,6 +77,7 @@ class allEvent: ...@@ -77,6 +77,7 @@ class allEvent:
# "_campaignid": 'default', # "_campaignid": 'default',
"_deviceid": i, "_deviceid": i,
"_imei": i, "_imei": i,
"mobdna_info": "{\"mobdna_oid\":\"95820f88217ec8cbdf621919bb81c0a5\",\"mobdna_appkey\":\"16dc0cb882d3dbec4f7f66251a84d6dd\",\"mobdna_rdid\":\"28B781FA18D703ECC2348EDD58B921F5\",\"mobdna_requestid\":\"463cfd5564d24d30a607a18a1e8ae2d8\"}",
# '_oaid': '697134960e9ff8df46f21b4f97db595a1', # '_oaid': '697134960e9ff8df46f21b4f97db595a1',
# "_rdid": '09DA91D0664C33DA7BEE7294CCCCCA07', # "_rdid": '09DA91D0664C33DA7BEE7294CCCCCA07',
# 'ua': 'Mozilla/5.0 (Linux; U; Android 7.0; zh-CN; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.89 UCBrowser/11.4.5.937 Mobile Safari/537.36', # 'ua': 'Mozilla/5.0 (Linux; U; Android 7.0; zh-CN; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.89 UCBrowser/11.4.5.937 Mobile Safari/537.36',
......
...@@ -8,7 +8,7 @@ import hashlib ...@@ -8,7 +8,7 @@ import hashlib
#安卓常规渠道激活 #安卓常规渠道激活
appkey = '65a61151b2af3ee371ada521a1f9efef' appkey = 'c48648ecb068a70408e93702e718cc49'
# 线上预约app # 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953 # 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd # 16dc0cb882d3dbec4f7f66251a84d6dd
...@@ -38,8 +38,8 @@ for index in range(1): ...@@ -38,8 +38,8 @@ for index in range(1):
# p = '987654321234567' # p = '987654321234567'
# s = '2321321312h8ro321' # s = '2321321312h8ro321'
# i = ''.join(str(random.choice(range(10))) for _ in range(12)) i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '686032665843' # i = '686032665843'
# i = '00000000-0000-0000-0000-000000000000' # i = '00000000-0000-0000-0000-000000000000'
# 随机生成ipXXXX XXCB489741-0029-4A35-8E38-D142F836B623 # 随机生成ipXXXX XXCB489741-0029-4A35-8E38-D142F836B623
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
...@@ -52,7 +52,7 @@ for index in range(1): ...@@ -52,7 +52,7 @@ for index in range(1):
# 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)
# allEvent().registerEvent(i, ip, appkey) # allEvent().registerEvent(i, ip, appkey)
# allEvent().payEvent(i, ip, appkey) # allEvent().payEvent(i, ip, appkey)
......
...@@ -8,11 +8,12 @@ import time ...@@ -8,11 +8,12 @@ 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/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://52.80.137.106:8083/tkio/rQrYJza?noredirect=true'
appkey = '8a390227254c03dbcaddbca009cd6e8b' appkey = 'ee977614c940fc833f474d0696b852a0'
# event = 'invoke' # event = 'invoke'
cmpaignid = '1122' cmpaignid = '1111'
# 广告创意ID # 广告创意ID
ry_adcreative_id = '9876543' ry_adcreative_id = '9876543'
# 广告组ID # 广告组ID
...@@ -52,13 +53,13 @@ for index in range(1): ...@@ -52,13 +53,13 @@ for index in range(1):
# 'creativeId':'21321321312123', # 'creativeId':'21321321312123',
# 'requestId':'312321321312', # 'requestId':'312321321312',
# 'adId': long('21231'), # 'adId': long('21231'),
'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,
"accountid": accountid # "accountid": accountid
} }
......
...@@ -3,40 +3,38 @@ import json ...@@ -3,40 +3,38 @@ import json
import time 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/' URL = 'http://52.80.137.106:8080/receive/tkio/'
URL = 'http://log.trackingio.com/receive/tkio/' # URL = 'http://log.trackingio.com/receive/tkio/'
# URL = 'http://120.53.212.71/receive/tkio/' # URL = 'http://120.53.212.71/receive/tkio/'
# URL = 'http://tlog.trackingio.com/receive/tkio/' # URL = 'http://tlog.trackingio.com/receive/tkio/'
# URL = 'http://jisulog.sortda.com/receive/tkio/' # URL = 'http://jisulog.sortda.com/receive/tkio/'
#时间戳 # 时间戳
current_time_13 = int(round(time.time() * 1000)) current_time_13 = int(round(time.time() * 1000))
#时间和日期 # 时间和日期
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()))
#设备品牌 # 设备品牌
manufacturer = 'vivo' manufacturer = 'vivo'
#设备系统 # 设备系统
ryos = 'android' ryos = 'android'
#设备类型 # 设备类型
rydevicetype = 'vivox9' rydevicetype = 'vivox9'
#网络类型 # 网络类型
network='wifi' network = 'wifi'
#分辨率 # 分辨率
resolution='1344*750' resolution = '1344*750'
#运行商 # 运行商
op='中国移动' op = '中国移动'
# 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay) # 支付类型 支付宝(alipay),银联(unionpay),微信支付(weixinpay),易宝支付(yeepay)
paymenttype = 'alipay' paymenttype = 'alipay'
#货币类型 # 货币类型
currencytype = 'CNY' currencytype = 'CNY'
#支付的货币金额 # 支付的货币金额
currencyamount = '45' currencyamount = '45'
when1 = '2020-06-04 10:00:00' when1 = '2020-06-04 10:00:00'
# (设备型号) # (设备型号)
...@@ -45,30 +43,33 @@ model = '' ...@@ -45,30 +43,33 @@ model = ''
ryosversion = '' ryosversion = ''
carrier = '中国联通' carrier = '中国联通'
lv = '1.5.0' lv = '1.5.0'
class allEvent: class allEvent:
# 激活 # 激活
def installUpload(self,i,IP,appkey,cmpaignid): def installUpload(self, i, IP, appkey, cmpaignid):
s = json.dumps({ s = json.dumps({
# "what":'install', # "what":'install',
"appid":appkey, "appid": appkey,
"context":{ "context": {
'_category': 'APPMARKET', '_category': 'APPMARKET',
"_campaignid": cmpaignid, "_campaignid": cmpaignid,
# "_channelid": cmpaignid, # "_channelid": cmpaignid,
"_deviceid":i, "_deviceid": i,
"_imei":i, "_imei": i,
"_androidid":i, "_androidid": i,
"_ip":IP, "_ip": IP,
'_manufacturer': manufacturer, '_manufacturer': manufacturer,
'_ryos': ryos, '_ryos': ryos,
'_rydevicetype': rydevicetype, '_rydevicetype': rydevicetype,
'_network': network, '_network': network,
'_resolution': resolution, '_resolution': resolution,
'_op':op, '_op': op,
'_timestamp':current_time_13, '_timestamp': current_time_13,
'uniqueName': '2221', 'uniqueName': '2221',
"_model": model, "_model": model,
"_ryosversion": ryosversion, "_ryosversion": ryosversion,
"mobdna_info": "{\"mobdna_oid\":\"95820f88217ec8cbdf621919bb81c0a5\",\"mobdna_appkey\":\"16dc0cb882d3dbec4f7f66251a84d6dd\",\"mobdna_rdid\":\"60AF84954A2AF80A07249708703519CB\",\"mobdna_requestid\":\"463cfd5564d24d30a607a18a1e8ae2d8\"}",
# 'adgroupId': '324322' # 'adgroupId': '324322'
...@@ -109,39 +110,37 @@ class allEvent: ...@@ -109,39 +110,37 @@ class allEvent:
}, },
'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())),
#time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())) # time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
'ds': ds, 'ds': ds,
'who': 'lxx_test' 'who': 'lxx_test'
}) })
p = requests.post(url=URL+'install',data=s,headers=headers,timeout=5) p = requests.post(url=URL + 'install', data=s, headers=headers, timeout=5)
print(p.text) print(p.text)
print(when) print(when)
# 注册
#注册 def registerEvent(self, i, IP, appkey):
def registerEvent(self,i,IP,appkey):
s = json.dumps({ s = json.dumps({
'what':'register', 'what': 'register',
'appid':appkey, 'appid': appkey,
'context':{ 'context': {
'_deviceid':i, '_deviceid': i,
'_imei':i, '_imei': i,
'_androidid':i, '_androidid': i,
'_ip':IP, '_ip': IP,
'_timestamp': current_time_13 '_timestamp': current_time_13
}, },
'when':when, 'when': when,
'ds':ds, 'ds': ds,
'who':'lxx_test' 'who': 'lxx_test'
}) })
p = requests.post(url=URL+'register',data=s,headers=headers,timeout=5) p = requests.post(url=URL + 'register', data=s, headers=headers, timeout=5)
print(p.text) print(p.text)
# 登陆
#登陆 def loginEvent(self, i, IP, appkey):
def loginEvent(self,i,IP,appkey):
s = json.dumps({ s = json.dumps({
'what': 'loggedin', 'what': 'loggedin',
'appid': appkey, 'appid': appkey,
...@@ -157,14 +156,13 @@ class allEvent: ...@@ -157,14 +156,13 @@ class allEvent:
'ds': ds, 'ds': ds,
'who': 'lxx_test' 'who': 'lxx_test'
}) })
p = requests.post(url=URL+'loggedin', data=s, headers=headers, timeout=5) p = requests.post(url=URL + 'loggedin', data=s, headers=headers, timeout=5)
print(p.text) print(p.text)
# 付费
#付费 def payEvent(self, i, IP, appkey):
# 订单号
def payEvent(self,i,IP,appkey):
#订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19)) transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({ s = json.dumps({
'what': 'payment', 'what': 'payment',
...@@ -175,7 +173,7 @@ class allEvent: ...@@ -175,7 +173,7 @@ class allEvent:
'_androidid': i, '_androidid': i,
'_ip': IP, '_ip': IP,
'_timestamp': current_time_13, '_timestamp': current_time_13,
'_transactionid':transactionid, '_transactionid': transactionid,
'_paymenttype': paymenttype, '_paymenttype': paymenttype,
'_currencytype': currencytype, '_currencytype': currencytype,
'_currencyamount': currencyamount, '_currencyamount': currencyamount,
...@@ -185,10 +183,11 @@ class allEvent: ...@@ -185,10 +183,11 @@ class allEvent:
'ds': ds, 'ds': ds,
'who': 'lxx_test' 'who': 'lxx_test'
}) })
p = requests.post(url=URL+'payment', data=s, headers=headers, timeout=5) p = requests.post(url=URL + 'payment', data=s, headers=headers, timeout=5)
print(p.text) print(p.text)
# 订单 # 订单
def orderEvent(self, i, IP, appkey): def orderEvent(self, i, IP, appkey):
# 订单号 # 订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19)) transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
...@@ -211,13 +210,11 @@ class allEvent: ...@@ -211,13 +210,11 @@ class allEvent:
'ds': ds, 'ds': ds,
'who': 'lxx_test' 'who': 'lxx_test'
}) })
p = requests.post(url=URL+'order', data=s, headers=headers, timeout=5) p = requests.post(url=URL + 'order', data=s, headers=headers, timeout=5)
print(p.text) print(p.text)
# 自定义事件
def ziding_event(self, i, IP, appkey, event):
#自定义事件
def ziding_event(self,i,IP,appkey,event):
s = json.dumps({ s = json.dumps({
'what': event, 'what': event,
'appid': appkey, 'appid': appkey,
...@@ -226,19 +223,19 @@ class allEvent: ...@@ -226,19 +223,19 @@ class allEvent:
'_imei': i, '_imei': i,
'_androidid': i, '_androidid': i,
'_ip': IP, '_ip': IP,
#识别是否为自定义事件,默认传1 # 识别是否为自定义事件,默认传1
'_isreyundefaultevent':'1' '_isreyundefaultevent': '1'
}, },
'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': ds, 'ds': ds,
'who': 'lxx_test' 'who': 'lxx_test'
}) })
p = requests.post(url=URL+'event', data=s, headers=headers, timeout=5) p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=5)
print(p.text) print(p.text)
# 自定义事件 # 自定义事件
def invoke_test(self, i, IP, appkey,cmpaignid): def invoke_test(self, i, IP, appkey, cmpaignid):
s = json.dumps({ s = json.dumps({
"what": "invoke", "what": "invoke",
"appType": "", "appType": "",
...@@ -260,7 +257,7 @@ class allEvent: ...@@ -260,7 +257,7 @@ class allEvent:
# "_idfa": "DBC93722-E34B-440C-B7A7-FB6641D0D9AB", # "_idfa": "DBC93722-E34B-440C-B7A7-FB6641D0D9AB",
"_idfv": i, "_idfv": i,
"_lib_version": lv, "_lib_version": lv,
"_carrier":carrier, "_carrier": carrier,
"_ry_ts": "1565941809416", "_ry_ts": "1565941809416",
"_create_timestamp": "1565941809351", "_create_timestamp": "1565941809351",
"_tz": "+8", "_tz": "+8",
...@@ -280,6 +277,5 @@ class allEvent: ...@@ -280,6 +277,5 @@ class allEvent:
"ds": when, "ds": when,
"who": "unknown" "who": "unknown"
}) })
p = requests.post(url=URL+'event', data=s, headers=headers, timeout=5) p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=5)
print("自定义" + p.text) print("自定义" + p.text)
...@@ -5,12 +5,12 @@ import random ...@@ -5,12 +5,12 @@ import random
import time import time
import time import time
#安卓分包激活 #安卓分包激活
appkey = '6012db28b7fbdfcb1e3a847756137f9b' appkey = 'ee977614c940fc833f474d0696b852a0'
#57ed2dd31596bb4682471e82c0c73c1a #57ed2dd31596bb4682471e82c0c73c1a
# 4b25b8a4dc584e63e9a7b81c3adedf2f # 4b25b8a4dc584e63e9a7b81c3adedf2f
# event = 'event_10' # event = 'event_10'
cmpaignid = '112222' 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))
...@@ -30,6 +30,4 @@ for index in range(1): ...@@ -30,6 +30,4 @@ for index in range(1):
# 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)
...@@ -86,7 +86,7 @@ def test_atb3(): ...@@ -86,7 +86,7 @@ def test_atb3():
redirectios.parms['idfa'] = i redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = computeMD5(i) redirectios.parms['idfa_md5'] = computeMD5(i)
redirectios.send_request3('') redirectios.send_request3('')
time.sleep(8) time.sleep(1)
receiveios.data[0]['device_info']['idfa'] = i receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i) receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['idfv'] = v receiveios.data[0]['device_info']['idfv'] = v
...@@ -771,7 +771,6 @@ def test_atb29(): ...@@ -771,7 +771,6 @@ def test_atb29():
# -------------------------------后续事件归因--------------------------------- # -------------------------------后续事件归因---------------------------------
# 目前无法验证后续事件是否匹配到了激活,等测试回调时一起测试该功能
# device_id相同-可通过device_id进行关联 # device_id相同-可通过device_id进行关联
def test_atb30(): def test_atb30():
i = idfacode() i = idfacode()
...@@ -876,20 +875,20 @@ def test_atb32(): ...@@ -876,20 +875,20 @@ def test_atb32():
def test_atb33(): def test_atb33():
i = idfacode() i = idfacode()
v = idfvcode() v = idfvcode()
# redirectios.parms['idfa'] = i redirectios.parms['idfa'] = i
# redirectios.parms['idfa_md5'] = computeMD5(i) redirectios.parms['idfa_md5'] = computeMD5(i)
# redirectios.send_request3('') redirectios.send_request3('')
# time.sleep(8) time.sleep(8)
# receiveios.data[0]['device_info']['idfa'] = i receiveios.data[0]['device_info']['idfa'] = i
# receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i) receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i)
# receiveios.data[0]['device_info']['idfv'] = v receiveios.data[0]['device_info']['idfv'] = v
# receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(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'] = i
# receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(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_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.send_request() receiveios.send_request()
# time.sleep(3) time.sleep(3)
receiveios.data[0]['device_info']['idfa'] = i receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i) receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['idfv'] = v receiveios.data[0]['device_info']['idfv'] = v
...@@ -1219,6 +1218,23 @@ def test_atb44(): ...@@ -1219,6 +1218,23 @@ def test_atb44():
print(i) print(i)
# 自然量
def test_atb46():
i = idfacode()
v = idfvcode()
receiveios.data[0]['device_info']['idfa'] = i
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_request()
print(i)
# -----------------------asa逻辑测试-------------------- # -----------------------asa逻辑测试--------------------
# 数据为测试数据,不是asa激活,走正常归因逻辑 # 数据为测试数据,不是asa激活,走正常归因逻辑
......
...@@ -234,11 +234,11 @@ def test_app_empty(): ...@@ -234,11 +234,11 @@ def test_app_empty():
assert response["status"] == "101" assert response["status"] == "101"
# appkey长度非法 # appkey不存在
def test_app_illegal_length(): def test_app_illegal_length():
data[0]["application_info"]["appkey"] = "74b81be2432c029040e0b2bc375ce7fb3" data[0]["application_info"]["appkey"] = "74b81be2432c029040e0b2bc375ce7fb3"
response = send_request() response = send_request()
assert response["status"] == "101" assert response["status"] == "190"
# bundleid为空 # bundleid为空
......
...@@ -102,9 +102,9 @@ def send_request(cs): ...@@ -102,9 +102,9 @@ def send_request(cs):
def send_request3(cs): def send_request3(cs):
global parms global parms
# 测试 # 测试
# url1 = 'http://tmtest.trackingio.com/receive/turl/I3eYvea' + cs url1 = 'http://tmtest.trackingio.com/receive/turl/JJvQFja' + 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)
......
...@@ -777,3 +777,22 @@ def test_at30(): ...@@ -777,3 +777,22 @@ def test_at30():
print(caid1) print(caid1)
print(caid2) print(caid2)
# 点击激活的idfa,caid,ip+ua,ip都相同,归因方式为idfa
def test_at31():
i = idfacode()
caid = code_nums1(36)
ip1 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa'] = i
clickios.parms['ip'] = ip1
clickios.parms['caid1'] = caid
clickios.send_requestandroid('')
time.sleep(8)
tkioreceive.data['context']['_deviceid'] = i
tkioreceive.data['context']['_idfa'] = i
tkioreceive.data['context']['_ip'] = ip1
tkioreceive.data['context']['_caid'] = caid
tkioreceive.send_request()
print(i)
print(ip1)
\ No newline at end of file
...@@ -32,8 +32,8 @@ parms = { ...@@ -32,8 +32,8 @@ parms = {
def send_requestandroid(hc): def send_requestandroid(hc):
# url1 = 'http://52.80.137.106:8083/tkio/JZzMnia?noredirect=true' + hc url1 = 'http://52.80.137.106:8083/tkio/ZRRjQra?noredirect=true' + hc
url1 = 'http://uri6.com/tkio/YjeERja?noredirect=true' + hc # url1 = 'http://uri6.com/tkio/YjeERja?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)
print(url1) print(url1)
......
...@@ -8,7 +8,7 @@ import hashlib ...@@ -8,7 +8,7 @@ import hashlib
data = { data = {
"what": "install", "what": "install",
"appid": "53acd3308411e0c4ab1f6444d7878aab", "appid": "7f43b32bad452c092096136c9be73d09",
"context": { "context": {
"_deviceid": "", "_deviceid": "",
"_idfa": "", "_idfa": "",
...@@ -24,6 +24,7 @@ data = { ...@@ -24,6 +24,7 @@ data = {
"_timestamp": 1655291783782, "_timestamp": 1655291783782,
"_model": "jixing", "_model": "jixing",
"_ryosversion": "13.6.1", "_ryosversion": "13.6.1",
"mobdna_info": "{\"mobdna_oid\":\"95820f88217ec8cbdf621919bb81c0a5\",\"mobdna_appkey\":\"16dc0cb882d3dbec4f7f66251a84d6dd\",\"mobdna_rdid\":\"ORRykMqaFSnIrDmGmF1tnvEwDwFYvA5w3TjMiucLZxQKQhIOVgghT0JUR9MbwJy1\",\"mobdna_requestid\":\"463cfd5564d24d30a607a18a1e8ae2d8\"}",
"__model": "jixing" "__model": "jixing"
}, },
"when": int(round(time.time() * 1000)), "when": int(round(time.time() * 1000)),
...@@ -41,9 +42,9 @@ data_temp = json.dumps(data) ...@@ -41,9 +42,9 @@ data_temp = json.dumps(data)
def send_request(): def send_request():
global data global data
# 测试 # 测试
# url = "http://52.80.137.106:8080/receive/tkio/install" url = "http://52.80.137.106:8080/receive/tkio/install"
# 线上 # 线上
url = "http://log.trackingio.com/receive/tkio/install" # url = "http://log.trackingio.com/receive/tkio/install"
data['context']['install_time'] = int(round(time.time() * 1000)) data['context']['install_time'] = int(round(time.time() * 1000))
print(data) print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data)) response = requests.request("POST", url, headers=headers, data=json.dumps(data))
......
...@@ -2,15 +2,15 @@ from xiaochengxu.xiaochenxu_script import allEvent ...@@ -2,15 +2,15 @@ from xiaochengxu.xiaochenxu_script import allEvent
import socket import socket
import struct import struct
import random import random
appkey = '9f6dfeed6a42210a781bafb7e62dc722' appkey = '30a90f0b0cfbde59b206bb046540a17f'
#cid #cid
cid = '11469' cid = '-1'
#surl #surl
surl = 'Evmu6na' surl = ''
for _ in range(50): for _ 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(28))
# i = '324014210339' # i = 'WEWRHWUEIEWRHEWR54HEWRUWEFCEWUFE'
# 随机生成ip # 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
......
...@@ -5,12 +5,12 @@ import random ...@@ -5,12 +5,12 @@ import random
headers = {'Content-Type': 'application/json'} headers = {'Content-Type': 'application/json'}
#测试环境 #测试环境
URL = 'http://10.2.20.42:8080/receive/tkio/event' # URL = 'http://10.2.20.42:8080/receive/tkio/event'
# URL = 'http://10.2.20.42:8080/receive/tkio/' # URL = 'http://10.2.20.42:8080/receive/tkio/'
#线上环境 #线上环境
# URL = 'http://log.reyun.com/receive/tkio/event'
# URL = 'http://tlog.trackingio.com/receive/tkio/event' # URL = 'http://tlog.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()))
...@@ -39,8 +39,8 @@ class allEvent: ...@@ -39,8 +39,8 @@ class allEvent:
"context": { "context": {
"_cid": cid, "_cid": cid,
"_ip": IP, "_ip": IP,
"_deviceid": 'null', "_deviceid": i,
# "_openid":i, "_openid":i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_apptype": "wx" "_apptype": "wx"
...@@ -53,6 +53,7 @@ class allEvent: ...@@ -53,6 +53,7 @@ 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)
print(p.url) print(p.url)
print(i)
# pv # pv
def pviaochengxu(self, i, IP, cid, surl, appid): def pviaochengxu(self, i, IP, cid, surl, appid):
......
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