Commit 15ed9f4b by liuxiaoxing

数据处理与归因逻辑优化

parent 6fcb6197
...@@ -25,14 +25,14 @@ def code_nums2(n=6): ...@@ -25,14 +25,14 @@ def code_nums2(n=6):
# from jiami.md5 import get_str_sha1_secret_str # from jiami.md5 import get_str_sha1_secret_str
# 向短链发送点击数据 # 向短链发送点击数据
# 广告创意ID # 广告创意ID
# ry_adcreative_id = code_nums2(6) ry_adcreative_id = code_nums2(6)
ry_adcreative_id = '453282367872' # ry_adcreative_id = '384609'
# 广告组ID # 广告组ID
# ry_adgroup_id = code_nums2(6) ry_adgroup_id = code_nums2(6)
ry_adgroup_id = '203346609' # ry_adgroup_id = '019750'
# 广告计划ID # 广告计划ID
# ry_adplan_id = code_nums2(6) ry_adplan_id = code_nums2(6)
ry_adplan_id = '7138970403' # ry_adplan_id = '258640'
# 广告组名称 # 广告组名称
ry_adgroup_name = 'c测试1' ry_adgroup_name = 'c测试1'
# 广告计划名称 # 广告计划名称
...@@ -41,8 +41,8 @@ ry_adplan_name = 'c测试1' ...@@ -41,8 +41,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/uq2uQna?noredirect=true' URL = 'http://uri6.com/tkio/NjeQJja?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/AZRvA3a?noredirect=true' # URL = 'http://52.80.137.106:8083/tkio/aI7j6va?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
...@@ -63,16 +63,16 @@ def computeMD5upper(message): ...@@ -63,16 +63,16 @@ def computeMD5upper(message):
return m.hexdigest().upper() return m.hexdigest().upper()
appkey = '88d7d29c4c7a49d2b5ec8d9723f70eb1' appkey = '5076ba423652a3254761d7493d9c80ad'
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
w = 0 w = 0
for index in range(10): 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 = '%*%5323423332233' # i = 'A1E36666F0EB4C25'
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))
...@@ -80,7 +80,7 @@ for index in range(10): ...@@ -80,7 +80,7 @@ for index in range(10):
# adid = '5011813780042235' # adid = '5011813780042235'
p1 = ''.join(str(random.choice(range(10))) for _ in range(12)) p1 = ''.join(str(random.choice(range(10))) for _ in range(12))
accountid = ''.join(str(random.choice(range(10))) for _ in range(12)) accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
# accountid = '37655892' # accountid = '383218638957'
# p1 = '测试一下' # p1 = '测试一下'
# "idfa": 'B5588C9C-4534-43FB-935D-F17C91622C83', # "idfa": 'B5588C9C-4534-43FB-935D-F17C91622C83',
# "idfa": '00000000-0000-0000-0000-000000000000', # "idfa": '00000000-0000-0000-0000-000000000000',
...@@ -134,8 +134,8 @@ for index in range(10): ...@@ -134,8 +134,8 @@ for index in range(10):
"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 # # # # 账户id
"accountid": accountid "accountid": accountid,
# 'imei2': 'null', # 'imei2': 'null',
# 'meid': i # 'meid': i
# 'bd_vid': i # 'bd_vid': i
...@@ -188,6 +188,7 @@ for index in range(10): ...@@ -188,6 +188,7 @@ for index in range(10):
print('success:', s) print('success:', s)
print(p.status_code) print(p.status_code)
print(p.content) print(p.content)
print("计划id:"+ry_adplan_id)
# print('androidid:',a) # print('androidid:',a)
# print(nowTime) # print(nowTime)
s = s + 1 s = s + 1
...@@ -200,18 +201,18 @@ for index in range(10): ...@@ -200,18 +201,18 @@ for index in range(10):
# print('androidid', a) # print('androidid', a)
w = w + 1 w = w + 1
# time.sleep(6) time.sleep(6)
# try: try:
# allEvent().installUpload(i, ip, appkey) allEvent().installUpload(i, ip, appkey)
# # allEvent().formevent(i, ip, appkey) # allEvent().formevent(i, ip, appkey)
#
# except Exception: except Exception:
# print('install_wrong:', w) print('install_wrong:', w)
# w = w + 1 w = w + 1
# # # # # # # # # #
# # # # # # # # # #
# time.sleep(10) # time.sleep(6)
# try: # try:
# allEvent().invoke_test(i, ip, appkey) # allEvent().invoke_test(i, ip, appkey)
# except Exception: # except Exception:
...@@ -268,7 +269,7 @@ for index in range(10): ...@@ -268,7 +269,7 @@ for index in range(10):
# try: # try:
# allEvent().appduration(i, ip, appkey,se) # allEvent().appduration(i, ip, appkey,se)
# # allEvent().formevent(i, ip, appkey) # # allEvent().formevent(i, ip, appkey)
# print("session:"+se) # # print("session:"+se)
# except Exception: # except Exception:
# print('install_wrong:', w) # print('install_wrong:', w)
# w = w + 1 # w = w + 1
...@@ -287,16 +288,16 @@ for index in range(10): ...@@ -287,16 +288,16 @@ for index in range(10):
# print('install_wrong:', w) # print('install_wrong:', w)
# w = w + 1 # w = w + 1
# #
# num = index + 1 num = index + 1
# # event = 'event_' + str(num) event = 'event_' + str(num)
# event = 'event_28' # event = 'event_28'
# time.sleep(3) time.sleep(2)
# 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:
......
...@@ -10,8 +10,8 @@ headers = {'Content-Type': 'application/json', 'X-RY-Access-Token': 'test_access ...@@ -10,8 +10,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/'
# 腾迅云tkio http协议的生产地址: # 腾迅云tkio http协议的生产地址:
...@@ -80,8 +80,8 @@ class allEvent: ...@@ -80,8 +80,8 @@ class allEvent:
# "_campaignid": 'default', # "_campaignid": 'default',
"_deviceid": i, "_deviceid": i,
"_imei": i, "_imei": i,
"_meid":'UNKNOWN', # "_meid":i,
"mobdna_info": "{\"mobdna_oid\":\"95820f88217ec8cbdf621919bb81c0a5\",\"mobdna_appkey\":\"16dc0cb882d3dbec4f7f66251a84d6dd\",\"mobdna_rdid\":\"96AD0BC02C70D0BA5C446C12580E3800\",\"mobdna_requestid\":\"463cfd5564d24d30a607a18a1e8ae2d8\"}", # "mobdna_info": "{\"mobdna_oid\":\"95820f88217ec8cbdf621919bb81c0a5\",\"mobdna_appkey\":\"16dc0cb882d3dbec4f7f66251a84d6dd\",\"mobdna_rdid\":\"96AD0BC02C70D0BA5C446C12580E3800\",\"mobdna_requestid\":\"463cfd5564d24d30a607a18a1e8ae2d8\"}",
'_oaid': i, '_oaid': i,
# "_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',
......
...@@ -10,7 +10,7 @@ import hashlib ...@@ -10,7 +10,7 @@ import hashlib
#安卓常规渠道激活 #安卓常规渠道激活
appkey = '83c18356b6ab202f007565b821e43e10' appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
# 线上预约app # 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953 # 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd # 16dc0cb882d3dbec4f7f66251a84d6dd
...@@ -30,7 +30,7 @@ appkey = '83c18356b6ab202f007565b821e43e10' ...@@ -30,7 +30,7 @@ appkey = '83c18356b6ab202f007565b821e43e10'
# allEvent().payEvent(i, ip, appkey) # allEvent().payEvent(i, ip, appkey)
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')) # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
for index in range(1): for index in range(40):
# 随机生成12为数组 # 随机生成12为数组
s = ''.join(str(random.choice(range(10))) for _ in range(18)) s = ''.join(str(random.choice(range(10))) for _ in range(18))
p = ''.join(str(random.choice(range(10))) for _ in range(12)) p = ''.join(str(random.choice(range(10))) for _ in range(12))
...@@ -41,7 +41,7 @@ for index in range(1): ...@@ -41,7 +41,7 @@ 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 = '778980150907' # i = '315141921832'
# 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)))
...@@ -63,10 +63,10 @@ for index in range(1): ...@@ -63,10 +63,10 @@ for index in range(1):
# time.sleep(1) # time.sleep(1)
# allEvent().payorder(i, ip, appkey) # allEvent().payorder(i, ip, appkey)
# 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)
...@@ -81,7 +81,7 @@ for index in range(1): ...@@ -81,7 +81,7 @@ for index in range(1):
# allEvent().batchUpload(i,ip,appkey) # allEvent().batchUpload(i,ip,appkey)
# allEvent().H5download(i,ip,appkey) # allEvent().H5download(i,ip,appkey)
# # time.sleep(1) # # time.sleep(1)
allEvent().H5pv(i,ip,appkey) # allEvent().H5pv(i,ip,appkey)
# # time.sleep(1) # # time.sleep(1)
# # # #
# allEvent().H5su(i,ip,appkey) # allEvent().H5su(i,ip,appkey)
......
...@@ -9,11 +9,11 @@ import time ...@@ -9,11 +9,11 @@ import time
#!!!!分包需要删掉https的s #!!!!分包需要删掉https的s
# URL = 'http://uri6.com/tkio/3uu6rya?noredirect=true' # URL = 'http://uri6.com/tkio/3uu6rya?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/RvYNJna?noredirect=true' URL = 'http://52.80.137.106:8083/tkio/NjiYvua?noredirect=true'
appkey = '5b0e99269160e67ef8e560716221e142' appkey = '345b0e19ef25ab3e7cc46770c2f16a3b'
# event = 'invoke' # event = 'invoke'
cmpaignid = '111' cmpaignid = '112233'
# 广告创意ID # 广告创意ID
ry_adcreative_id = '9876543' ry_adcreative_id = '9876543'
# 广告组ID # 广告组ID
...@@ -29,7 +29,7 @@ ry_adcreative_name = '广告创意' ...@@ -29,7 +29,7 @@ ry_adcreative_name = '广告创意'
s = 0 s = 0
w = 0 w = 0
for index in range(1): for index in range(40):
#随机生成12为数组 #随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12)) i = ''.join(str(random.choice(range(10))) for _ in range(12))
...@@ -103,19 +103,19 @@ for index in range(1): ...@@ -103,19 +103,19 @@ for index in range(1):
# 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:
allEvent().payEvent(i, ip, appkey)
except Exception:
print('付费_wrong:', w)
# num = index + 1
# event = 'event_' + str(num)
# event = 'event_28'
# time.sleep(3)
# try: # try:
# allEvent().ziding_event(i, ip, appkey,event) # allEvent().payEvent(i, ip, appkey)
# except Exception: # except Exception:
# print('自定义_wrong:', w) # print('付费_wrong:', w)
num = index + 1
event = 'event_' + str(num)
# event = 'event_28'
time.sleep(2)
try:
allEvent().ziding_event(i, ip, appkey,event)
except Exception:
print('自定义_wrong:', w)
......
...@@ -5,23 +5,23 @@ import random ...@@ -5,23 +5,23 @@ import random
import time import time
import time import time
#安卓分包激活 #安卓分包激活
appkey = 'f461b1ab7aca6fdf3fa719bf4b6af863' appkey = '345b0e19ef25ab3e7cc46770c2f16a3b'
#57ed2dd31596bb4682471e82c0c73c1a #57ed2dd31596bb4682471e82c0c73c1a
# 4b25b8a4dc584e63e9a7b81c3adedf2f # 4b25b8a4dc584e63e9a7b81c3adedf2f
# event = 'event_10' # event = 'event_10'
cmpaignid = '1111' cmpaignid = '1122'
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 = 'q27dux0c9d5mv9413cp903d07a8q1ipf' i = '189894848469'
# 随机生成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
......
...@@ -100,14 +100,14 @@ for _ in range(1): ...@@ -100,14 +100,14 @@ for _ in range(1):
print('idfa:', i) print('idfa:', i)
print('ip', ip) print('ip', ip)
w = w + 1 w = w + 1
# time.sleep(10) time.sleep(10)
# try: try:
# allEvent().installUpload(i, ip, appkey) allEvent().installUpload(i, ip, appkey)
# # allEvent().formevent(i, ip, appkey) # allEvent().formevent(i, ip, appkey)
#
# except Exception: except Exception:
# print('install_wrong:', w) print('install_wrong:', w)
# w = w + 1 w = w + 1
# time.sleep(3) # time.sleep(3)
# try: # try:
# allEvent().adshow(i, ip, appkey,adid) # allEvent().adshow(i, ip, appkey,adid)
......
...@@ -8,8 +8,8 @@ import random ...@@ -8,8 +8,8 @@ import random
headers = {'Content-Type': 'application/json'} headers = {'Content-Type': 'application/json'}
# URL = 'http://10.2.20.42:8080/receive/tkio/' # URL = 'http://10.2.20.42:8080/receive/tkio/'
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/'
#时间戳 #时间戳
......
...@@ -6,7 +6,7 @@ import string ...@@ -6,7 +6,7 @@ import string
import time import time
#iOS常规渠道激活 #iOS常规渠道激活
appkey = '0ecc232109dc25bfedff8aba06271539' appkey = '60763edf19602c0fa27b967c282fe805'
event = 'event_1' event = 'event_1'
for index in range(5): for index in range(5):
...@@ -40,7 +40,7 @@ for index in range(5): ...@@ -40,7 +40,7 @@ for index in range(5):
# # event = 'event_' + str(num) # # event = 'event_' + str(num)
# event = 'event_1' # event = 'event_1'
# allEvent().ziding_event(i, ip, appkey, event) # allEvent().ziding_event(i, ip, appkey, event)
print(event) # print(event)
# allEvent().adshow(i,ip,appkey,adid) # allEvent().adshow(i,ip,appkey,adid)
# allEvent().adclick(i,ip,appkey,adid) # allEvent().adclick(i,ip,appkey,adid)
# allEvent().pageduration(i,ip,appkey,se,p) # allEvent().pageduration(i,ip,appkey,se,p)
......
...@@ -24,6 +24,20 @@ def computeMD5upper(message): ...@@ -24,6 +24,20 @@ def computeMD5upper(message):
return m.hexdigest().upper() return m.hexdigest().upper()
n = 10
def code_nums(n=6):
ret = ''
for i in range(n):
num = random.randint(0, 9)
letter = chr(random.randint(97, 122))
s = str(random.choice([num, letter]))
ret += s
return ret
def idfacode(): def idfacode():
ret = '' ret = ''
a = "".join(random.sample(string.ascii_letters + string.digits, 8)) a = "".join(random.sample(string.ascii_letters + string.digits, 8))
...@@ -1922,6 +1936,9 @@ def test_impatb9(): ...@@ -1922,6 +1936,9 @@ def test_impatb9():
# 1.传一个激活,google自归因查询为true,2.last touch来自google渠道 # 1.传一个激活,google自归因查询为true,2.last touch来自google渠道
# 归因为google,并通知google # 归因为google,并通知google
# google归因 # google归因
...@@ -1973,8 +1990,8 @@ def test_atbgoogle2(): ...@@ -1973,8 +1990,8 @@ def test_atbgoogle2():
# asa激活 # asa激活
def test_atbgoogle3(): def test_atbgoogle3():
i = idfacode() # i = idfacode()
# i = '3C3FA051-DB2A-4F4F-9154-BC15EF565750' i = '9C3FA051-DB2A-4F4F-9154-BC15EF565773'
v = idfvcode() v = idfvcode()
receiveios.data[0]['device_info']['idfa'] = i receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['timestamp_info']['current_event_time'] = '1659148260199' receiveios.data[0]['timestamp_info']['current_event_time'] = '1659148260199'
...@@ -2023,6 +2040,8 @@ def test_atbgoogle4(): ...@@ -2023,6 +2040,8 @@ def test_atbgoogle4():
print(i) print(i)
#激活中idfa为空 #激活中idfa为空
def test_atbgoogle5(): def test_atbgoogle5():
i2 = idfacode() i2 = idfacode()
...@@ -2049,4 +2068,110 @@ def test_atbgoogle5(): ...@@ -2049,4 +2068,110 @@ def test_atbgoogle5():
# -------------------数据处理与归因逻辑优化----------------------
def test_at_newipv4():
i = idfacode()
v = idfvcode()
redirectios.parms['ipv4'] = ip
redirectios.parms['idfa'] = code_nums(37)
redirectios.parms['idfa_md5'] = code_nums(33)
redirectios.parms['idfv'] = code_nums(37)
redirectios.parms['idfv_md5'] = code_nums(33)
redirectios.parms['is_s2s'] = '1'
redirectios.parms['touchpoint_type'] = 'click'
redirectios.parms['attribution_type'] = 'ua'
redirectios.send_request3('')
time.sleep(3)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = ''
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'] = ''
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = ''
receiveios.data[0]['device_info']['ipv4'] = ip
receiveios.send_request()
print(i)
def test_at_newidfa():
i = idfacode()
v = idfvcode()
redirectios.parms['ipv4'] = code_nums(129)
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = code_nums(33)
redirectios.parms['idfv'] = code_nums(37)
redirectios.parms['idfv_md5'] = code_nums(33)
redirectios.parms['is_s2s'] = '1'
redirectios.parms['touchpoint_type'] = 'click'
redirectios.parms['attribution_type'] = 'ua'
redirectios.send_request3('')
time.sleep(3)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = ''
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'] = ''
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = ''
receiveios.data[0]['device_info']['ipv4'] = ip
receiveios.send_request()
time.sleep(6)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = ''
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'] = ''
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = ''
receiveios.data[0]['device_info']['ipv4'] = ip
receiveios.data[0]["event_info"]['event_name'] = 'register'
receiveios.data[0]["event_info"]['event_type'] = 'preset'
receiveios.send_request()
print(i)
def test_at_newidfa_md5():
i = idfacode()
i2 = code_nums(32)
v = idfvcode()
redirectios.parms['ipv4'] = code_nums(129)
redirectios.parms['idfa'] = code_nums(37)
redirectios.parms['idfa_md5'] = i2
redirectios.parms['idfv'] = code_nums(37)
redirectios.parms['idfv_md5'] = code_nums(33)
redirectios.parms['is_s2s'] = '1'
redirectios.parms['touchpoint_type'] = 'click'
redirectios.parms['attribution_type'] = 'ua'
redirectios.send_request3('')
time.sleep(3)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = 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'] = i2
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']['ipv4'] = ip
receiveios.send_request()
print(i)
# -------------------------所以设备都非法-------------------------
def test_at_newclick1():
i = idfacode()
v = idfvcode()
redirectios.parms['ipv4'] = code_nums(129)
redirectios.parms['idfa'] = code_nums(37)
redirectios.parms['idfa_md5'] = code_nums(33)
redirectios.parms['idfv'] = code_nums(37)
redirectios.parms['idfv_md5'] = code_nums(33)
redirectios.parms['is_s2s'] = '1'
redirectios.parms['touchpoint_type'] = 'click'
redirectios.parms['attribution_type'] = 'ua'
redirectios.send_request3('')
...@@ -46,7 +46,7 @@ global data ...@@ -46,7 +46,7 @@ global data
data = [ data = [
{ {
"application_info": { "application_info": {
"appkey": "666", "appkey": "111",
"bundleid": "3423232", "bundleid": "3423232",
"app_version": "1", "app_version": "1",
"channel_name": "HUAWEI" "channel_name": "HUAWEI"
...@@ -137,9 +137,9 @@ def send_request(): ...@@ -137,9 +137,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))
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))
...@@ -193,9 +193,9 @@ def send_requestgoogle(): ...@@ -193,9 +193,9 @@ def send_requestgoogle():
# 对接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"
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))
...@@ -1259,7 +1259,6 @@ def test_event_name1(): ...@@ -1259,7 +1259,6 @@ def test_event_name1():
# event_type为custom # event_type为custom
def test_event_name2(): def test_event_name2():
# lst = []
newList = ['222', 'wwqeWEW', 'We2_32e'] newList = ['222', 'wwqeWEW', 'We2_32e']
for event in newList: for event in newList:
data[0]["event_info"]['event_name'] = event data[0]["event_info"]['event_name'] = event
......
...@@ -193,9 +193,9 @@ def send_requestgoogle(): ...@@ -193,9 +193,9 @@ def send_requestgoogle():
# 对接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))
......
...@@ -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/uaa6N3a' + cs url1 = 'http://tmtest.trackingio.com/receive/turl/vMjIBza' + 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)
...@@ -149,10 +149,10 @@ def test_idfa3(): ...@@ -149,10 +149,10 @@ def test_idfa3():
# idfa非32字符 # idfa非32字符
def test_idfa4(): # def test_idfa4():
parms['idfa'] = zf35 # parms['idfa'] = zf35
re = send_request('') # re = send_request('')
assert re["status"] == 124 # assert re["status"] == 124
# idfa_md5为空 # idfa_md5为空
...@@ -177,10 +177,10 @@ def test_idfa_md53(): ...@@ -177,10 +177,10 @@ def test_idfa_md53():
# idfa_md5非32字符 # idfa_md5非32字符
def test_idfa_md54(): # def test_idfa_md54():
parms['idfa_md5'] = zf35 # parms['idfa_md5'] = zf35
re = send_request('') # re = send_request('')
assert re["status"] == 187 # assert re["status"] == 187
# idfv和idfv_md5同上 # idfv和idfv_md5同上
...@@ -206,10 +206,10 @@ def test_idfv3(): ...@@ -206,10 +206,10 @@ def test_idfv3():
# idfv非32字符 # idfv非32字符
def test_idfv4(): # def test_idfv4():
parms['idfv'] = zf35 # parms['idfv'] = zf35
re = send_request('') # re = send_request('')
assert re["status"] == 125 # assert re["status"] == 125
...@@ -235,10 +235,10 @@ def test_idfv_md53(): ...@@ -235,10 +235,10 @@ def test_idfv_md53():
# idfv_md5非32字符 # idfv_md5非32字符
def test_idfv_md54(): # def test_idfv_md54():
parms['idfv_md5'] = zf35 # parms['idfv_md5'] = zf35
re = send_request('') # re = send_request('')
assert re["status"] == 188 # assert re["status"] == 188
...@@ -246,21 +246,21 @@ def test_idfv_md54(): ...@@ -246,21 +246,21 @@ def test_idfv_md54():
def test_oaid(): def test_oaid():
parms['oaid'] = '3DEA635F-B24F-434B-833F-4ED028FEAEE' parms['oaid'] = '3DEA635F-B24F-434B-833F-4ED028FEAEE'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传oaid_md5 # 短链是ios,传oaid_md5
def test_oaid_md5(): def test_oaid_md5():
parms['oaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['oaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传imei1 # 短链是ios,传imei1
def test_imei1(): def test_imei1():
parms['imei1'] = '8342732742383' parms['imei1'] = '8342732742383'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
...@@ -268,35 +268,35 @@ def test_imei1(): ...@@ -268,35 +268,35 @@ def test_imei1():
def test_imei1_md5(): def test_imei1_md5():
parms['imei1_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['imei1_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传imei2 # 短链是ios,传imei2
def test_imei2(): def test_imei2():
parms['imei2'] = '8342732742383' parms['imei2'] = '8342732742383'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传imei2_md5 # 短链是ios,传imei2_md5
def test_imei2_md5(): def test_imei2_md5():
parms['imei2_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['imei2_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传gaid # 短链是ios,传gaid
def test_gaid(): def test_gaid():
parms['gaid'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0' parms['gaid'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传gaid_md5 # 短链是ios,传gaid_md5
def test_gaid_md5(): def test_gaid_md5():
parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['gaid_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
...@@ -304,7 +304,7 @@ def test_gaid_md5(): ...@@ -304,7 +304,7 @@ def test_gaid_md5():
def test_mac(): def test_mac():
parms['mac'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0' parms['mac'] = 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
...@@ -312,14 +312,14 @@ def test_mac(): ...@@ -312,14 +312,14 @@ def test_mac():
def test_mac_md5(): def test_mac_md5():
parms['mac_md5'] = '8e488a40a17aed2f6752f51382a4eafc' parms['mac_md5'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
# 短链是ios,传android_id # 短链是ios,传android_id
def test_android_id(): def test_android_id():
parms['android_id'] = '1a34fc556a43c453' parms['android_id'] = '1a34fc556a43c453'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
...@@ -327,7 +327,7 @@ def test_android_id(): ...@@ -327,7 +327,7 @@ def test_android_id():
def test_android_id_md5(): def test_android_id_md5():
parms['android_id'] = '8e488a40a17aed2f6752f51382a4eafc' parms['android_id'] = '8e488a40a17aed2f6752f51382a4eafc'
re = send_request('') re = send_request('')
assert re["status"] == 115 assert re["status"] == 219
......
...@@ -42,17 +42,31 @@ def computeMD5upper(message): ...@@ -42,17 +42,31 @@ def computeMD5upper(message):
return m.hexdigest().upper() return m.hexdigest().upper()
# md5加密转xiao # md5加密转
def computeMD5lower(message): def computeMD5lower(message):
m = hashlib.md5() m = hashlib.md5()
m.update(message.encode(encoding='utf-8')) m.update(message.encode(encoding='utf-8'))
return m.hexdigest() return m.hexdigest()
# SHA加密
def computesha(message):
sha = hashlib.sha1(message.encode('utf-8'))
encrypts = sha.hexdigest()
print(encrypts)
return encrypts
# 生成小写字母加数字组合 # 生成小写字母加数字组合
n = 10 n = 10
def test_sha1():
computesha("111")
def code_nums1(n=6): def code_nums1(n=6):
ret = '' ret = ''
for i in range(n): for i in range(n):
...@@ -194,9 +208,9 @@ def test_at6(): ...@@ -194,9 +208,9 @@ def test_at6():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(5) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2 tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip tkioreceive.data['context']['_ip'] = ip
...@@ -218,8 +232,8 @@ def test_at7(): ...@@ -218,8 +232,8 @@ def test_at7():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(5) time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -243,8 +257,8 @@ def test_at8(): ...@@ -243,8 +257,8 @@ def test_at8():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(5) time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -268,8 +282,8 @@ def test_at9(): ...@@ -268,8 +282,8 @@ def test_at9():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(6) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -347,7 +361,7 @@ def test_at12(): ...@@ -347,7 +361,7 @@ def test_at12():
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
clickios.send_requestandroid('') clickios.send_requestandroid('')
time.sleep(5) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2 tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip tkioreceive.data['context']['_ip'] = ip
...@@ -370,8 +384,8 @@ def test_at13(): ...@@ -370,8 +384,8 @@ def test_at13():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = computeMD5upper(caid) clickios.parms['caid1'] = computeMD5upper(caid)
clickios.parms['caid2'] = caid2 clickios.parms['caid2'] = caid2
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(6) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -448,8 +462,8 @@ def test_at16(): ...@@ -448,8 +462,8 @@ def test_at16():
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = '' clickios.parms['caid1'] = ''
clickios.parms['caid2'] = caid clickios.parms['caid2'] = caid
# clickios.send_requestandroid('') clickios.send_requestandroid('')
clickios.send_requestandroid('&preorder=true') # clickios.send_requestandroid('&preorder=true')
time.sleep(6) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
...@@ -511,7 +525,7 @@ def test_at18(): ...@@ -511,7 +525,7 @@ def test_at18():
clickios.parms['caid1'] = '' clickios.parms['caid1'] = ''
clickios.parms['caid2'] = caid clickios.parms['caid2'] = caid
clickios.send_requestandroid('') clickios.send_requestandroid('')
time.sleep(5) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2 tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip tkioreceive.data['context']['_ip'] = ip
...@@ -541,7 +555,7 @@ def test_at19(): ...@@ -541,7 +555,7 @@ def test_at19():
clickios.parms['caid1'] = '' clickios.parms['caid1'] = ''
clickios.parms['caid2'] = caid clickios.parms['caid2'] = caid
clickios.send_requestandroid('') clickios.send_requestandroid('')
time.sleep(5) time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2 tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2 tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip tkioreceive.data['context']['_ip'] = ip
...@@ -930,3 +944,58 @@ def test_firstclick(): ...@@ -930,3 +944,58 @@ def test_firstclick():
print(i2) print(i2)
print(ip1) print(ip1)
print(ip2) print(ip2)
# jointype-归因方式补充
# sha idfa 暂时无法归因
def test_sha():
i = idfacode()
i2 = idfacode()
caid = code_nums1(32)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa_MD5'] = computesha(i)
clickios.parms['idfa'] = ''
clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid
clickios.send_requestandroid('')
# clickios.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i
tkioreceive.data['context']['_idfa'] = i
tkioreceive.data['context']['_ip'] = ip
tkioreceive.data['context']['_caid'] = caid
tkioreceive.send_request()
print(i)
print(ip)
# no_line_idfa
def test_no_line_idfa():
i = 'ZRNDIT5KU5OHWXAUVZL5AQWOTIRB2CY2'
i2 = 'ZRNDIT5K-U5OH-WXAU-VZL5-AQWOTIRB2CY2'
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('')
# clickios.send_requestandroid('&preorder=true')
time.sleep(6)
tkioreceive.data['context']['_deviceid'] = i2
tkioreceive.data['context']['_idfa'] = i2
tkioreceive.data['context']['_ip'] = ip1
tkioreceive.data['context']['_caid'] = caid
tkioreceive.send_request()
print(i)
print(ip1)
...@@ -34,11 +34,12 @@ parms = { ...@@ -34,11 +34,12 @@ parms = {
def send_requestandroid(hc): def send_requestandroid(hc):
url1 = 'http://52.80.137.106:8083/tkio/MfyEzya?noredirect=true' + hc # url1 = 'http://52.80.137.106:8083/tkio/MfyEzya?noredirect=true' + hc
# url1 = 'http://uri6.com/tkio/26rQJza?noredirect=true' + hc url1 = 'http://uri6.com/tkio/bmEJrea?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)
print(parms)
return response return response
......
...@@ -33,7 +33,7 @@ parms = { ...@@ -33,7 +33,7 @@ parms = {
def send_requestandroid(hc): def send_requestandroid(hc):
# url1 = 'http://52.80.137.106:8083/tkio/F3QVrqa?noredirect=true' + hc # url1 = 'http://52.80.137.106:8083/tkio/F3QVrqa?noredirect=true' + hc
url1 = 'http://uri6.com/tkio/uUFN7fa?noredirect=true' + hc url1 = 'http://uri6.com/tkio/ayERVfa?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": "b21d0385ad8371de9e90b3e969a5d0c6", "appid": "60763edf19602c0fa27b967c282fe805",
"context": { "context": {
"_deviceid": "", "_deviceid": "",
"_idfa": "", "_idfa": "",
...@@ -42,9 +42,9 @@ data_temp = json.dumps(data) ...@@ -42,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))
......
...@@ -8,7 +8,7 @@ import hashlib ...@@ -8,7 +8,7 @@ import hashlib
data = { data = {
"what": "install", "what": "install",
"appid": "5b0e99269160e67ef8e560716221e142", "appid": "894ef23136b0a6bb039800aa217f2729",
"context": { "context": {
"_deviceid": "", "_deviceid": "",
"_imei": "", "_imei": "",
...@@ -42,11 +42,11 @@ data_temp = json.dumps(data) ...@@ -42,11 +42,11 @@ 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://52.80.137.106:8080/receive/tkio/event" # url = "http://52.80.137.106:8080/receive/tkio/event"
# 线上 # 线上
# 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))
......
...@@ -7,37 +7,39 @@ import requests ...@@ -7,37 +7,39 @@ import requests
appkey = '74131e54a444aa5a8597e73b646cba77' appkey = '74131e54a444aa5a8597e73b646cba77'
# cid # cid
cid = '21164' cid = '21075'
# surl # surl
surl = 'mAbeqaa' surl = 'J32uqia'
# URL = 'http://52.80.137.106:8083/tkio/EjABBra?noredirect=true' URL = 'http://52.80.137.106:8083/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
# URL = 'http://uri6.com/tkio/BVjQf2a?noredirect=true' # URL = 'http://uri6.com/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
impressionid = ''.join(str(random.choice(range(10))) for _ in range(12)) impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
requestid = ''.join(str(random.choice(range(10))) for _ in range(12)) requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
s = 0 s = 0
for _ in range(1): for index in range(40):
# 随机生成12为数组 # 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(28)) i = ''.join(str(random.choice(range(10))) for _ in range(28))
i = '2539452844786738942022514936' # i = '2539452844786738942022514936'
# 随机生成ip # 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# # 打开 # 打开
# allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid, requestid) allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid, requestid)
# # # time.sleep(5) # # # 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)
# # # time.sleep(2) # # # time.sleep(2)
allEvent().regedchengxu(i, ip, cid, surl, appkey) # allEvent().regedchengxu(i, ip, cid, surl, appkey)
# # # time.sleep(2) # # # time.sleep(2)
# allEvent().loggedinchengxu(i, ip, cid, surl, appkey) # allEvent().loggedinchengxu(i, ip, cid, surl, appkey)
# time.sleep(2) # time.sleep(2)
# allEvent().paymentchengxu(i,ip,cid,surl,appkey) # allEvent().paymentchengxu(i,ip,cid,surl,appkey)
# time.sleep(2) time.sleep(2)
# allEvent().eventchengxu(i,ip,cid,surl,appkey) num = index + 1
event = 'event_' + str(num)
allEvent().eventchengxu(i,ip,cid,surl,appkey,event)
# for index in range(1): # for index in range(1):
...@@ -48,9 +50,9 @@ for _ in range(1): ...@@ -48,9 +50,9 @@ for _ 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为数组
# # impressionid = ''.join(str(random.choice(range(10))) for _ in range(12)) # # impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
# impressionid = '111222334455' # impressionid = '111222334455667788'
# # requestid = ''.join(str(random.choice(range(10))) for _ in range(12)) # # requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
# requestid = '1112223344' # requestid = '111222334455'
# accountid = ''.join(str(random.choice(range(10))) for _ in range(12)) # accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
# # 随机生成ip # # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) # ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
...@@ -58,14 +60,16 @@ for _ in range(1): ...@@ -58,14 +60,16 @@ for _ in range(1):
# try: # try:
# parms = { # parms = {
# 'click_time': str(round(time.time() * 1000)), # 'click_time': str(round(time.time() * 1000)),
# # 'click_time': '1663309200', # # 'click_time': '1667308011000',
# 'wechat_openid': i,
# 'click_id':'123456789',
# 'accountid': accountid, # 'accountid': accountid,
# 'ip': ip, # 'ip': ip,
# 'impression_id': impressionid, # 'impression_id': impressionid,
# 'request_id': requestid, # 'request_id': requestid,
# '_ry_adgroup_id': '333', # '_ry_adgroup_id': '222',
# '_ry_adplan_id': "333", # '_ry_adplan_id': "222",
# '_ry_adcreative_id': '333' # '_ry_adcreative_id': '222'
# } # }
# # timeout可以超时四秒 # # timeout可以超时四秒
# # verify = False # # verify = False
...@@ -106,7 +110,7 @@ for _ in range(1): ...@@ -106,7 +110,7 @@ for _ in range(1):
# # #离开 # # #离开
# time.sleep(2) # time.sleep(2)
# allEvent().hidechengxu(i,ip,cid,surl,appkey) # allEvent().hidechengxu(i,ip,cid,surl,appkey)
# time.sleep(200) # time.sleep(2)
# allEvent().regedchengxu(i, ip, cid, surl, appkey) # allEvent().regedchengxu(i, ip, cid, surl, appkey)
# time.sleep(2) # time.sleep(2)
# allEvent().loggedinchengxu(i,ip,cid,surl,appkey) # allEvent().loggedinchengxu(i,ip,cid,surl,appkey)
......
...@@ -44,18 +44,19 @@ class allEvent: ...@@ -44,18 +44,19 @@ class allEvent:
"_openid": i, "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "434444", "_sceneid": "434444",
"gdt_vid": '1112223344', "gdt_vid": '1112223344556677',
# "ry_adgroup_id": "111", "_ry_adgroup_id": "111",
# "ry_adplan_id": "111", "_ry_adplan_id": "111",
# "ry_adcreative_id": "111", "_ry_adcreative_id": "111",
# "accountid":"123456", "accountid":"123456",
'impression_id': impressionid, 'impression_id': impressionid,
'request_id': requestid, 'request_id': requestid,
# 投放广告详情-头条 # 投放广告详情-头条
"advertiser_id": "ccc", "advertiser_id": "ccc",
"ad_id": "ccc", "ad_id": "ccc",
"creative_id": "ccc", "creative_id": "ccc",
"_apptype": "wx" "_apptype": "wg"
}, },
"where": "launch", "where": "launch",
# "when": when, # "when": when,
...@@ -102,7 +103,7 @@ class allEvent: ...@@ -102,7 +103,7 @@ class allEvent:
"_openid": i, "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_apptype": "wx", "_apptype": "wg",
"_num_pages": "5", "_num_pages": "5",
"_duration": "10" "_duration": "10"
}, },
...@@ -126,7 +127,8 @@ class allEvent: ...@@ -126,7 +127,8 @@ class allEvent:
"_openid": i, "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_apptype": "wx", # wg-小游戏
"_apptype": "wg",
"_num_pages": "5", "_num_pages": "5",
"_duration": "10" "_duration": "10"
}, },
...@@ -153,7 +155,7 @@ class allEvent: ...@@ -153,7 +155,7 @@ class allEvent:
"_openid": i, "_openid": i,
"_campaignid": surl, "_campaignid": surl,
"_sceneid": "unknown", "_sceneid": "unknown",
"_apptype": "wx", "_apptype": "wg",
"_num_pages": "5", "_num_pages": "5",
'_transactionid': transactionid, '_transactionid': transactionid,
'_paymenttype': paymenttype, '_paymenttype': paymenttype,
...@@ -198,9 +200,9 @@ class allEvent: ...@@ -198,9 +200,9 @@ class allEvent:
print(p.text) print(p.text)
# 自定义事件 # 自定义事件
def eventchengxu(self, i, IP, cid, surl, appid): def eventchengxu(self, i, IP, cid, surl, appid,event):
s = json.dumps({ s = json.dumps({
"what": "event_10", "what": event,
"appid": appid, "appid": appid,
"context": { "context": {
"_cid": cid, "_cid": cid,
......
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