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
} }
......
...@@ -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