Commit 2ff466af by liuxiaoxing

新增tkio归因脚本

parent 40b87de6
...@@ -39,7 +39,7 @@ ry_adcreative_name = 'c测试1' ...@@ -39,7 +39,7 @@ 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://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/vMn2eea?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/a6ZVNba?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 = '3f2706b7afdf89d95ffa7d2e9cc13e2e' appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
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
......
...@@ -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/'
......
...@@ -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)
......
...@@ -75,7 +75,7 @@ def test_at1(): ...@@ -75,7 +75,7 @@ def test_at1():
clickios.parms['idfa'] = i clickios.parms['idfa'] = i
clickios.parms['ip'] = ip1 clickios.parms['ip'] = ip1
clickios.send_requestandroid('') clickios.send_requestandroid('')
time.sleep(3) time.sleep(10)
clickios.parms['idfa'] = i2 clickios.parms['idfa'] = i2
clickios.parms['ip'] = ip2 clickios.parms['ip'] = ip2
clickios.send_requestandroid('') clickios.send_requestandroid('')
...@@ -165,7 +165,7 @@ def test_at5(): ...@@ -165,7 +165,7 @@ def test_at5():
caid = code_nums1(32) caid = code_nums1(32)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa_MD5'] = computeMD5upper(i) clickios.parms['idfa_MD5'] = computeMD5upper(i)
clickios.parms['idfa'] = i clickios.parms['idfa'] = ''
clickios.parms['ip'] = ip clickios.parms['ip'] = ip
clickios.parms['caid1'] = caid clickios.parms['caid1'] = caid
clickios.send_requestandroid('') clickios.send_requestandroid('')
...@@ -452,7 +452,6 @@ def test_at17(): ...@@ -452,7 +452,6 @@ def test_at17():
caid2 = code_nums1(32) caid2 = code_nums1(32)
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
ip2 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ip2 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa_MD5'] = computeMD5upper(i) clickios.parms['idfa_MD5'] = computeMD5upper(i)
clickios.parms['idfa'] = i clickios.parms['idfa'] = i
clickios.parms[ clickios.parms[
...@@ -471,7 +470,6 @@ def test_at17(): ...@@ -471,7 +470,6 @@ def test_at17():
tkioreceive.data['context'][ tkioreceive.data['context'][
'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)'
tkioreceive.send_request() tkioreceive.send_request()
print(i)
print(i2) print(i2)
print(ip) print(ip)
...@@ -707,4 +705,75 @@ def test_at27(): ...@@ -707,4 +705,75 @@ def test_at27():
tkioreceive.send_request() tkioreceive.send_request()
print(i) print(i)
print(i2) print(i2)
print(ip1) print(ip1)
\ No newline at end of file
# 特殊渠道CAID传值处理
# Bilibili
def test_at28():
i = idfacode()
i2 = idfacode()
ip1 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa'] = i
clickios.parms['ip'] = ip1
clickios.parms[
'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)'
clickios.parms['caid'] = '20201201_f249f306494646edfee0f939698e1fb8%2C20210101_f049f306494646edfee0f939698e1fb5'
clickios.send_requestandroid('')
time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i
tkioreceive.data['context']['_idfa'] = i
tkioreceive.data['context']['_ip'] = ip1
tkioreceive.data['context']['_caid1'] = 'f249f306494646edfee0f939698e1fb8'
tkioreceive.data['context']['_caid2'] = 'f049f306494646edfee0f939698e1fb5'
tkioreceive.data['context'][
'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)'
tkioreceive.send_request()
print(i)
print(i2)
print(ip1)
# (新)广点通,cid:17797
def test_at29():
i = idfacode()
ip1 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa'] = i
clickios.parms['ip'] = ip1
clickios.parms['caid'] = '%5B%7B%22qaid%22%3A%2212345%22%2C%22hash_qaid%22%3A%22123456789012345%22%2C%22version%22%3A%221003%22%7D%2C%7B%22qaid%22%3A%2267890%22%2C%22hash_qaid%22%3A%226789523654780214556%22%2C%22version%22%3A%221006%22%7D%5D'
clickios.send_requestandroid('')
print('点击')
time.sleep(5)
tkioreceive.data['context']['_deviceid'] = i
tkioreceive.data['context']['_idfa'] = i
tkioreceive.data['context']['_ip'] = ip1
tkioreceive.data['context']['_caid1'] = '123456789012345'
tkioreceive.data['context']['_caid2'] = '6789523654780214556'
tkioreceive.data['context'][
'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)'
tkioreceive.send_request()
print(i)
# 点击存储
def test_at30():
i = idfacode()
caid = code_nums1(15)
caid1 = code_nums1(36)
caid2 = code_nums1(36)
ip1 = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
clickios.parms['idfa'] = i
clickios.parms['ip'] = ip1
clickios.parms['caid'] = caid
clickios.parms['caid1'] = caid1
clickios.parms['caid2'] = caid2
clickios.send_requestandroid('')
print(i)
print(ip1)
print(caid)
print(caid1)
print(caid2)
...@@ -17,12 +17,12 @@ ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ...@@ -17,12 +17,12 @@ ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
parms = { parms = {
'click_time': str(round(time.time() * 1000)), # 'click_time': str(round(time.time() * 1000)),
'idfa': '', 'imei': '',
'idfa_MD5': '', 'oaid': '',
# 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287', # 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287',
'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': '',
# ios # ios
# 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) # 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)
# android # android
...@@ -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/3u63Uza?noredirect=true' + hc # url1 = 'http://52.80.137.106:8083/tkio/yM3y6fa?noredirect=true' + hc
# url1 = 'https://uri6.com/tkio/Q3um6na?noredirect=true' + hc url1 = 'http://uri6.com/tkio/q6VFJva?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False) response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text) print(response.text)
print(url1) print(url1)
......
...@@ -17,7 +17,7 @@ ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) ...@@ -17,7 +17,7 @@ ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
parms = { parms = {
'click_time': str(round(time.time() * 1000)), # 'click_time': str(round(time.time() * 1000)),
'idfa': '', 'idfa': '',
'idfa_MD5': '', 'idfa_MD5': '',
# 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287', # 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287',
...@@ -32,9 +32,10 @@ parms = { ...@@ -32,9 +32,10 @@ parms = {
def send_requestandroid(hc): def send_requestandroid(hc):
url1 = 'http://52.80.137.106:8083/tkio/3u63Uza?noredirect=true' + hc # url1 = 'http://52.80.137.106:8083/tkio/JZzMnia?noredirect=true' + hc
# url1 = 'https://uri6.com/tkio/Q3um6na?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)
return response return response
...@@ -8,12 +8,13 @@ import hashlib ...@@ -8,12 +8,13 @@ import hashlib
data = { data = {
"what": "install", "what": "install",
"appid": "7f43b32bad452c092096136c9be73d09", "appid": "53acd3308411e0c4ab1f6444d7878aab",
"context": { "context": {
"_deviceid": "", "_deviceid": "",
"_idfa": "", "_idfa": "",
"_idfv": "", "_idfv": "",
"_ip": "", "_ip": "",
'customAttrParams': 'ip+ua',
"_manufacturer": "vivo", "_manufacturer": "vivo",
"_ryos": "ios", "_ryos": "ios",
"_rydevicetype": "vivox9", "_rydevicetype": "vivox9",
...@@ -40,9 +41,9 @@ data_temp = json.dumps(data) ...@@ -40,9 +41,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,14 +8,14 @@ import hashlib ...@@ -8,14 +8,14 @@ import hashlib
data = { data = {
"what": "install", "what": "install",
"appid": "7f43b32bad452c092096136c9be73d09", "appid": "8a390227254c03dbcaddbca009cd6e8b",
"context": { "context": {
"_deviceid": "", "_deviceid": "",
"_idfa": "", "_imei": "",
"_idfv": "", "_oaid": "",
"_ip": "", "_ip": "",
"_manufacturer": "vivo", "_manufacturer": "vivo",
"_ryos": "ios", "_ryos": "android",
"_rydevicetype": "vivox9", "_rydevicetype": "vivox9",
"_networktype": "5g", "_networktype": "5g",
"_resolution": "1344*750", "_resolution": "1344*750",
...@@ -24,6 +24,7 @@ data = { ...@@ -24,6 +24,7 @@ data = {
"_model": "jixing", "_model": "jixing",
"_ryosversion": "13.6.1", "_ryosversion": "13.6.1",
"__model": "jixing" "__model": "jixing"
}, },
"when": int(round(time.time() * 1000)), "when": int(round(time.time() * 1000)),
"ds": "2022-06-15", "ds": "2022-06-15",
...@@ -37,12 +38,31 @@ headers = { ...@@ -37,12 +38,31 @@ headers = {
data_temp = json.dumps(data) 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"
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
def send_requestlogin():
global data
# 测试
# url = "http://52.80.137.106:8080/receive/tkio/loggedin"
# 线上 # 线上
# url = "http://log.trackingio.com/receive/tkio/install" url = "http://log.trackingio.com/receive/tkio/loggedin"
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))
......
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