Commit 469433c8 by liuxiaoxing

日常迭代

parent 09e8ad69
...@@ -52,8 +52,8 @@ ry_adplan_name = 'c测试1' ...@@ -52,8 +52,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/ry2MN3a?order_id=987688761&demand_id=987688761&itemid=987688761&noredirect=true' URL = 'http://uri6.com/tkio/VZZ7Ffa?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/3Qz2Ufa?noredirect=true' # URL = 'http://52.80.137.106:8083/tkio/3Qz2Ufa?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
...@@ -146,8 +146,12 @@ for index in range(1): ...@@ -146,8 +146,12 @@ for index in range(1):
"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,
# 巨量2.0
# "project_id":proiect_id, # "project_id":proiect_id,
# "advert_id":advert_id, # "advert_id":advert_id,
# # "project_name": proiect_name, # # "project_name": proiect_name,
# # "advert_name": advert_name, # # "advert_name": advert_name,
# # # # # # 账户id # # # # # # 账户id
...@@ -217,14 +221,14 @@ for index in range(1): ...@@ -217,14 +221,14 @@ for index in range(1):
# 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
# # # # # # # # # #
# # # # # # # # # #
...@@ -248,11 +252,11 @@ for index in range(1): ...@@ -248,11 +252,11 @@ 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(3) time.sleep(3)
# try: try:
# allEvent().payEvent(i, ip, appkey) allEvent().payEvent(i, ip, appkey)
# except Exception as err: except Exception as err:
# print(err) print(err)
# print('付费_wrong:', w) # print('付费_wrong:', w)
# time.sleep(3) # time.sleep(3)
# try: # try:
......
...@@ -40,7 +40,7 @@ paymenttype = 'alipay' ...@@ -40,7 +40,7 @@ paymenttype = 'alipay'
# 货币类型 # 货币类型
currencytype = 'CNY' currencytype = 'CNY'
# 支付的货币金额 # 支付的货币金额
currencyamount = '90.3455' currencyamount = '90'
# # 填充广告在变现平台的广告位ID # # 填充广告在变现平台的广告位ID
# adid = '839296815' # adid = '839296815'
# 填充广告的变现平台,例如穿山甲(csj)、优量汇(ylh)、百青藤(bqt)、Sigmob(sigmob)、快手(ks)、Mintegral(mintegral)、OneWay(oneway)、Vungle(vungle)等 # 填充广告的变现平台,例如穿山甲(csj)、优量汇(ylh)、百青藤(bqt)、Sigmob(sigmob)、快手(ks)、Mintegral(mintegral)、OneWay(oneway)、Vungle(vungle)等
......
...@@ -10,7 +10,7 @@ import hashlib ...@@ -10,7 +10,7 @@ import hashlib
#安卓常规渠道激活 #安卓常规渠道激活
appkey = '7f43b32bad452c092096136c9be73d09' appkey = 'd58151cfff3f88b7fd3372fa5f596b44'
# 线上预约app # 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953 # 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd # 16dc0cb882d3dbec4f7f66251a84d6dd
...@@ -52,7 +52,7 @@ for index in range(1): ...@@ -52,7 +52,7 @@ for index in range(1):
# 海市 # 海市
# 119.60.0.0 宁夏回族自治区银川市 # 119.60.0.0 宁夏回族自治区银川市
# start_time = time.time() # start_time = time.time()
# allEvent().installUpload(i, ip, appkey) allEvent().installUpload(i, ip, appkey)
# # print("time===>",(time.time()-start_time)) # # print("time===>",(time.time()-start_time))
# # time.sleep(1) # # time.sleep(1)
# allEvent().startupEvent(i, ip, appkey) # allEvent().startupEvent(i, ip, appkey)
......
...@@ -8,8 +8,8 @@ import time ...@@ -8,8 +8,8 @@ import time
#向短链发送点击数据 #向短链发送点击数据
#!!!!分包需要删掉https的s #!!!!分包需要删掉https的s
# URL = 'http://uri6.com/tkio/fUf6jua?noredirect=true' URL = 'http://uri6.com/tkio/ai6naaa?noredirect=true'
URL = 'http://52.80.137.106:8083/tkio/2yyEnua?noredirect=true' # URL = 'http://52.80.137.106:8083/tkio/2yyEnua?noredirect=true'
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd' appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
# event = 'invoke' # event = 'invoke'
......
...@@ -69,8 +69,6 @@ for _ in range(1): ...@@ -69,8 +69,6 @@ for _ in range(1):
# 'idfa_MD5': computeMD5upper(i), # 'idfa_MD5': computeMD5upper(i),
# 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287', # 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287',
# 'muid':i, # 'muid':i,
# 'oaid':'654324352124312232',
# 'oaid_MD5': 'FCAF473729CE701E95A9422F5FBCD607',
'ip': ip, 'ip': ip,
'ua': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.30.0 baiduboxapp/12.13.0.10 (Baidu; P2 13.6.1)', 'ua': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 SP-engine/2.30.0 baiduboxapp/12.13.0.10 (Baidu; P2 13.6.1)',
# ios # ios
...@@ -83,7 +81,6 @@ for _ in range(1): ...@@ -83,7 +81,6 @@ for _ in range(1):
"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,
# 'mac': mac
} }
# timeout可以超时四秒 # timeout可以超时四秒
p = requests.get(url=URL, params=parms, timeout=4, verify=False) p = requests.get(url=URL, params=parms, timeout=4, verify=False)
......
...@@ -178,7 +178,7 @@ def test_atb1(): ...@@ -178,7 +178,7 @@ def test_atb1():
i = code_nums(12) i = code_nums(12)
redirectandroid.parms['oaid'] = i redirectandroid.parms['oaid'] = i
redirectandroid.send_request3('') redirectandroid.send_request3('')
time.sleep(5) time.sleep(10)
receiveandroid.data[0]['device_info']['device_id'] = i receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['oaid'] = i receiveandroid.data[0]['device_info']['oaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid' receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
...@@ -1544,16 +1544,16 @@ def test_impatb16(): ...@@ -1544,16 +1544,16 @@ def test_impatb16():
# 单独的点击 # 单独的点击
def test_click(): def test_click():
i = code_nums(12) i = code_nums(12)
redirectandroid.parms['touchpoint_type'] = 'impression' # redirectandroid.parms['touchpoint_type'] = 'impression'
redirectandroid.parms['oaid'] = '90tg5ut753a2' redirectandroid.parms['oaid'] = i
redirectandroid.send_request3('') redirectandroid.send_request3('')
print(i) print(i)
# 单独的激活 # 单独的激活
def test_install(): def test_install():
# i = '23A051-DB2A-4F4F-9154-BC15EF565752' i = '90tg5ut753a21'
i = code_nums(12) # i = code_nums(12)
receiveandroid.data[0]['device_info']['device_id'] = i receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['oaid'] = i receiveandroid.data[0]['device_info']['oaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid' receiveandroid.data[0]['device_info']['device_id_type'] = 'oaid'
...@@ -1564,20 +1564,20 @@ def test_install(): ...@@ -1564,20 +1564,20 @@ def test_install():
# 单独的点击 # 单独的点击
def test_click(): # def test_click1():
i = code_nums(12) # i = code_nums(12)
# redirectandroid.parms['touchpoint_type'] = 'impression' # # redirectandroid.parms['touchpoint_type'] = 'impression'
redirectandroid.parms['gaid'] = '9C3FA000-DB2A-4F4F-9154-BC15EF565772' # redirectandroid.parms['gaid'] = '9C3FA000-DB2A-4F4F-9154-BC15EF565772'
# redirectandroid.parms['ts'] = '1668997850000' # # redirectandroid.parms['ts'] = '1668997850000'
redirectandroid.send_request3('') # redirectandroid.send_request3('')
print(i) # print(i)
def test_atbgoogle(): def test_atbgoogle():
i = code_nums(36) # i = code_nums(36)
# i = '9C3FA051-DB0A-4F4F-1004-BC15EF565787' i = '9C3FA051-DB2A-4F4F-0011-BC15EF565121'
receiveandroid.data[0]['timestamp_info']['current_event_time'] = '1668847756000' receiveandroid.data[0]['timestamp_info']['current_event_time'] = '1675996225000'
receiveandroid.data[0]['device_info']['device_id'] = i receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['imei1'] = '' receiveandroid.data[0]['device_info']['imei1'] = ''
receiveandroid.data[0]['device_info']['gaid'] = i receiveandroid.data[0]['device_info']['gaid'] = i
...@@ -1585,6 +1585,31 @@ def test_atbgoogle(): ...@@ -1585,6 +1585,31 @@ def test_atbgoogle():
receiveandroid.data[0]['device_info']['os'] = '1' receiveandroid.data[0]['device_info']['os'] = '1'
receiveandroid.data[0]['device_info']['os_version'] = '1.0' receiveandroid.data[0]['device_info']['os_version'] = '1.0'
receiveandroid.send_requestgoogle() receiveandroid.send_requestgoogle()
time.sleep(20)
receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['gaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'gaid'
receiveandroid.data[0]["event_info"]['event_name'] = 'purchase'
receiveandroid.data[0]["event_info"]['event_type'] = 'preset'
receiveandroid.data[0]['timestamp_info']['current_event_time'] = '1675996225000'
receiveandroid.data[0]["event_info"]["event_data"]['order_amount'] = "0"
receiveandroid.send_requestgoogle()
print(i)
def test_atbopen():
# i = code_nums(36)
i = '9C3FA051-DB2A-4F4F-0001-BC15EF565120'
receiveandroid.data[0]['device_info']['device_id'] = i
receiveandroid.data[0]['device_info']['gaid'] = i
receiveandroid.data[0]['device_info']['device_id_type'] = 'gaid'
receiveandroid.data[0]["event_info"]['event_name'] = 'custom'
# custom
receiveandroid.data[0]["event_info"]['event_type'] = 'open'
# receiveandroid.data[0]['timestamp_info']['current_event_time'] = '1668847756000'
receiveandroid.data[0]["event_info"]["event_data"]['order_amount'] = "0"
receiveandroid.send_requestgoogle()
print(i) print(i)
......
...@@ -100,7 +100,7 @@ def test_atb3(): ...@@ -100,7 +100,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(1) time.sleep(2)
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
......
import hashlib
def computeMD5(message):
m = hashlib.md5()
m.update(message.encode(encoding='utf-8'))
return m.hexdigest()
id1 ='9C3FA051-DB2A-4F4F-0011-BC15EF565121'+'lxx-test20230214'+'install'+'1675996225000'
# id2 ='9C3FA051-DB2A-4F4F-9154-BC15EF565104'+'lxx-test20230214'+'install'+'1668847756000'
# id3 ='9C3FA051-DB2A-4F4F-9154-BC15EF565104'+'lxx-test20230214'+'install'+'1668847756000'
tenjin_id1 = computeMD5(id1).upper()
# tenjin_id2 = computeMD5(id1).upper()
# tenjin_id3 = computeMD5(id1).upper()
print(tenjin_id1)
# print(tenjin_id2)
# print(tenjin_id3)
\ No newline at end of file
...@@ -46,8 +46,8 @@ global data ...@@ -46,8 +46,8 @@ global data
data = [ data = [
{ {
"application_info": { "application_info": {
"appkey": "344234354", "appkey": "lxx-test20230214",
"bundleid": "grere34543f4r4", "bundleid": "987654321",
# www.jd111.com # www.jd111.com
"app_version": "1", "app_version": "1",
"channel_name": "google" "channel_name": "google"
...@@ -100,7 +100,7 @@ data = [ ...@@ -100,7 +100,7 @@ data = [
"register_type": "WeChat", "register_type": "WeChat",
"login_type": "Wechat", "login_type": "Wechat",
"order_id": "2341242342676398724", "order_id": "2341242342676398724",
"order_amount": "30", # "order_amount": "30",
"currency_type": "CNY", "currency_type": "CNY",
"purchase_type": "Alipay", "purchase_type": "Alipay",
"ad_platform": "csj", "ad_platform": "csj",
...@@ -138,10 +138,10 @@ def send_request(): ...@@ -138,10 +138,10 @@ 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))
...@@ -1255,12 +1255,11 @@ def test_event_name2(): ...@@ -1255,12 +1255,11 @@ def test_event_name2():
for event in newList: for event in newList:
data[0]["event_info"]['event_name'] = event data[0]["event_info"]['event_name'] = event
data[0]["event_info"]['event_type'] = "custom" data[0]["event_info"]['event_type'] = "custom"
response = send_request() response = send_request()
assert response["status"] == "0" assert response["status"] == "0"
# event_type为preset,event为自定义事件 # event_type为preset(预置),event为自定义事件
def test_event_name3(): def test_event_name3():
# lst = [] # lst = []
newList = ['222', 'wwqeWEW', 'We2_32e'] newList = ['222', 'wwqeWEW', 'We2_32e']
......
...@@ -42,7 +42,7 @@ global data ...@@ -42,7 +42,7 @@ global data
data = [ data = [
{ {
"application_info": { "application_info": {
"appkey": "222", "appkey": "a75815182d534cb0",
"bundleid": "3423232", "bundleid": "3423232",
"app_version": "1", "app_version": "1",
"channel_name": "default" "channel_name": "default"
......
...@@ -144,9 +144,10 @@ def send_request2(): ...@@ -144,9 +144,10 @@ def send_request2():
def send_request3(cs): def send_request3(cs):
global parms global parms
# 测试 # 测试
# url1 = 'http://tmtest.trackingio.com/receive/turl/myyAJza' + cs # QzIBnya
url1 = 'http://tmtest.trackingio.com/receive/turl/QzIBnya' + cs
# 线上 # 线上
url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/aie6vya' + cs # url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/aie6vya' + cs
parms['ts'] = int(round(time.time() * 1000)) parms['ts'] = int(round(time.time() * 1000))
# parms['ts'] = int(round(time.time())) # parms['ts'] = int(round(time.time()))
......
...@@ -106,7 +106,7 @@ def send_request3(cs): ...@@ -106,7 +106,7 @@ def send_request3(cs):
# 测试 # 测试
# url1 = 'http://tmtest.trackingio.com/receive/turl/vMjIBza' + 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/AvEj6ba' + 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)
......
...@@ -153,8 +153,8 @@ def test_oaid1(): ...@@ -153,8 +153,8 @@ def test_oaid1():
clickandroid.parms['mac'] = mac clickandroid.parms['mac'] = mac
clickandroid.parms['muid'] = '' clickandroid.parms['muid'] = ''
clickandroid.parms['ip'] = ip clickandroid.parms['ip'] = ip
# clickandroid.send_requestandroid('') clickandroid.send_requestandroid('')
clickandroid.send_requestandroid('&preorder=true') # clickandroid.send_requestandroid('&preorder=true')
time.sleep(5) time.sleep(5)
tkioreceiveandroid.data['context']['_deviceid'] = i tkioreceiveandroid.data['context']['_deviceid'] = i
......
...@@ -35,7 +35,7 @@ parms = { ...@@ -35,7 +35,7 @@ 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/bmEJrea?noredirect=true' + hc url1 = 'http://uri6.com/tkio/jeAzqia?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)
......
...@@ -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/VFnQFja?noredirect=true' + hc # url1 = 'http://52.80.137.106:8083/tkio/VFnQFja?noredirect=true' + hc
url1 = 'http://uri6.com/tkio/zArQRza?noredirect=true' + hc url1 = 'http://uri6.com/tkio/AvEj6ba?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)
......
...@@ -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))
......
...@@ -4,28 +4,44 @@ import struct ...@@ -4,28 +4,44 @@ import struct
import random import random
import time import time
import requests import requests
from xiaochengxu import xiaochenxu_script
appkey = 'afbb574bc0e1d7326fc92140399509ef' # appkey = 'e10a66c81e666da98b1ed781126dcbeb'
# cid # cid
cid = '21075' # cid = '21075'
# surl # surl
surl = 'MNreUfa' # surl = 'MNreUfa'
# URL = 'http://52.80.137.106:8083/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111' # URL = 'http://52.80.137.106:8083/tkio/ey67fua?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
URL = 'http://uri6.com/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111' # 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
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
for index in range(5):
# 随机生成12为数组 # 生成小写字母加数字组合
# i = ''.join(str(random.choice(range(10))) for _ in range(28)) n = 10
i = '64532454323234223'
# 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) def code_nums(n=6):
ret = ''
# 打开 for i in range(n):
allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid) num = random.randint(0, 9)
time.sleep(2) letter = chr(random.randint(97, 122))
s = str(random.choice([num, letter]))
ret += s
return ret
# for index in range(5):
# # 随机生成12为数组
# # i = ''.join(str(random.choice(range(10))) for _ in range(28))
# i = '64532454323234223'
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
#
# # 打开
# allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid)
# time.sleep(2)
# # # #pv # # # #pv
# # # allEvent().pviaochengxu(i,ip,cid,surl,appkey) # # # allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# # # # # #离开 # # # # # #离开
...@@ -46,7 +62,6 @@ for index in range(5): ...@@ -46,7 +62,6 @@ for index in range(5):
# i = ''.join(str(random.choice(range(10))) for _ in range(28)) # i = ''.join(str(random.choice(range(10))) for _ in range(28))
# # i = '1761453021140876860117396099' # # i = '1761453021140876860117396099'
# #
#
# # 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))
...@@ -62,7 +77,7 @@ for index in range(5): ...@@ -62,7 +77,7 @@ for index in range(5):
# 'click_time': str(round(time.time() * 1000)), # 'click_time': str(round(time.time() * 1000)),
# # 'click_time': '1667308011000', # # 'click_time': '1667308011000',
# # 'wechat_openid': i, # # 'wechat_openid': i,
# 'click_id':'123456789', # 'click_id': '123456789',
# 'accountid': accountid, # 'accountid': accountid,
# 'ip': ip, # 'ip': ip,
# 'impression_id': impressionid, # 'impression_id': impressionid,
...@@ -95,14 +110,14 @@ for index in range(5): ...@@ -95,14 +110,14 @@ for index in range(5):
# # print(p.status_code) # # print(p.status_code)
# # print('androidid', a) # # print('androidid', a)
# w = w + 1 # w = w + 1
#
# time.sleep(2) # time.sleep(2)
# try: # try:
# allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid) # allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid)
# #
# except Exception: # except Exception:
# print('install_wrong:', w) # print('install_wrong:', w)
# w = w + 1 # w = w + 1
# # pv # # pv
# time.sleep(2) # time.sleep(2)
...@@ -115,6 +130,130 @@ for index in range(5): ...@@ -115,6 +130,130 @@ for index in range(5):
# 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) # allEvent().eventchengxu(i, ip, cid, surl, appkey)
parms = {
# 'click_time': str(round(time.time() * 1000)),
# 'click_time': '1676861385000',
# 'wechat_openid': i,
'click_id': '123456789',
'accountid': '111121',
'ip': ip,
'impression_id': '',
# 'request_id': requestid,
'_ry_adgroup_id': '222',
'_ry_adplan_id': "222",
'_ry_adcreative_id': '222'
}
surl = 'nEJ77za'
# Abmyuia
# zU7Z3ua
def send_requestandroid(hc):
# url1 = 'http://52.80.137.106:8083/tkio/' + surl + '?noredirect=true' + hc
url1 = 'http://uri6.com/tkio/' + surl + '?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text)
print(url1)
print(parms)
return response
def test_click():
i = code_nums(16)
parms['click_id'] = i
send_requestandroid('')
time.sleep(3)
xiaochenxu_script.data['context']['gdt_vid'] = i
xiaochenxu_script.data['context']['_openid'] = i
xiaochenxu_script.data['context']['_deviceid'] = i
xiaochenxu_script.data['context']['_campaignid'] = surl
xiaochenxu_script.data['context']['_cid'] = '21059'
xiaochenxu_script.send_request()
print(i)
def test_impressionid():
i = code_nums(16)
parms['impression_id'] = i
parms['click_id'] = '2132132'
send_requestandroid('')
time.sleep(3)
xiaochenxu_script.data['context']['gdt_vid'] = i
xiaochenxu_script.data['context']['_openid'] = i
xiaochenxu_script.data['context']['_deviceid'] = i
xiaochenxu_script.data['context']['_campaignid'] = surl
xiaochenxu_script.data['context']['_cid'] = '21059'
xiaochenxu_script.send_request()
print(i)
def test_requestid():
i = code_nums(16)
parms['request_id'] = i
parms['click_id'] = '2132132'
send_requestandroid('')
time.sleep(3)
xiaochenxu_script.data['context']['gdt_vid'] = i
xiaochenxu_script.data['context']['_openid'] = i
xiaochenxu_script.data['context']['_deviceid'] = i
xiaochenxu_script.data['context']['_campaignid'] = surl
xiaochenxu_script.data['context']['_cid'] = '21059'
xiaochenxu_script.send_request()
print(i)
def test_atb1():
i1 = code_nums(16)
i2 = code_nums(16)
openid = code_nums(18)
parms['impression_id'] = i1
parms['click_id'] = i2
send_requestandroid('')
time.sleep(3)
xiaochenxu_script.data['context']['gdt_vid'] = i1
xiaochenxu_script.data['context']['_openid'] = i1
xiaochenxu_script.data['context']['_deviceid'] = i1
xiaochenxu_script.data['context']['_campaignid'] = surl
xiaochenxu_script.data['context']['_cid'] = '21059'
xiaochenxu_script.send_request()
time.sleep(3)
xiaochenxu_script.data['context']['gdt_vid'] = i2
xiaochenxu_script.data['context']['_openid'] = i2
xiaochenxu_script.data['context']['_deviceid'] = i2
xiaochenxu_script.data['context']['_campaignid'] = surl
xiaochenxu_script.data['context']['_cid'] = '21059'
xiaochenxu_script.send_request()
print(i1)
print(i2)
def test_launch():
i = code_nums(16)
xiaochenxu_script.data['context']['gdt_vid'] = i
xiaochenxu_script.data['context']['_openid'] = i
xiaochenxu_script.data['context']['_deviceid'] = i
xiaochenxu_script.data['context']['_campaignid'] = surl
xiaochenxu_script.data['context']['_cid'] = '21059'
xiaochenxu_script.send_request()
print(i)
def test_wg():
i = code_nums(16)
parms['wechat_openid'] = i
send_requestandroid('')
time.sleep(3)
xiaochenxu_script.data['context']['gdt_vid'] = i
xiaochenxu_script.data['context']['_openid'] = i
xiaochenxu_script.data['context']['_deviceid'] = i
xiaochenxu_script.data['context']['_campaignid'] = surl
xiaochenxu_script.data['context']['_cid'] = '21059'
xiaochenxu_script.data['context']['_apptype'] = 'wg'
xiaochenxu_script.data['appid'] = '1cb67e8beb1fe0d5a9c000f6f05b58e5'
xiaochenxu_script.send_request()
print(i)
...@@ -2,6 +2,10 @@ import requests ...@@ -2,6 +2,10 @@ import requests
import json import json
import time import time
import random import random
import socket
import struct
headers = {'Content-Type': 'application/json'} headers = {'Content-Type': 'application/json'}
# 测试环境 # 测试环境
...@@ -30,6 +34,8 @@ currencyamount = '45' ...@@ -30,6 +34,8 @@ currencyamount = '45'
# 是否热云默认,标记为自定义事件 # 是否热云默认,标记为自定义事件
isreyundefaultevent = '' isreyundefaultevent = ''
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
class allEvent: class allEvent:
# 打开小程序 # 打开小程序
...@@ -224,3 +230,61 @@ class allEvent: ...@@ -224,3 +230,61 @@ 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)
data = {
"what": "launch",
"appid": '30a90f0b0cfbde59b206bb046540a17f',
"context": {
"_cid": '',
"_ip": ip,
"_deviceid": '222',
"_openid": '2222',
"_campaignid": '',
"_sceneid": "434444",
"gdt_vid": '',
"_ry_adgroup_id": "111",
"_ry_adplan_id": "111",
"_ry_adcreative_id": "111",
"accountid": "123456",
# 投放广告详情-头条
# "advertiser_id": "333",
# "ad_id": "333",
# "creative_id": "333",
# "project_id": "333",
# "advert_id": "333",
"_apptype": "wx"
},
"where": "launch",
# "when": when,
"ds": ds,
"who": "lxx-test"
}
headers = {
'Content-Type': 'application/json'
}
data_temp = json.dumps(data)
def send_request():
global data
# 测试
# url = "http://52.80.137.106:8080/receive/tkio/install"
# url = "http://52.80.137.106:8080/receive/tkio/event"
# 线上
url = "http://log.trackingio.com/receive/tkio/install"
# data['context']['install_time'] = int(round(time.time() * 1000))
print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data))
print(response.text)
# 全局data
data = json.loads(data_temp)
response = json.loads(response.text)
s = str(response["status"])
response["status"] = s
return response
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment