Commit 40b87de6 by liuxiaoxing

新增tkio归因脚本

parent a2defc1e
......@@ -1547,7 +1547,7 @@ def test_asa14():
def test_asa15():
i = idfacode()
v = idfvcode()
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_inf5d7db80b4af9dd26b9723d1eaf5b5249o']['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)
......
......@@ -37,7 +37,7 @@ global data
data = [
{
"application_info": {
"appkey": "2c81418e218b4879b904a45530f0a09e",
"appkey": "2a33891fd3ea53f8edb0fca391a2432e",
"bundleid": "3423232",
"app_version": "1.9.0",
"channel_name": "default"
......@@ -160,9 +160,9 @@ def send_request():
# 对接se地址
# 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']['current_event_time'] = int(round(time.time() * 1000))
......
......@@ -102,9 +102,9 @@ def send_request(cs):
def send_request3(cs):
global parms
# 测试
# url1 = 'http://tmtest.trackingio.com/receive/turl/I3eYvea' + cs
url1 = 'http://tmtest.trackingio.com/receive/turl/I3eYvea' + cs
# 线上
url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/qY7fQza' + cs
# url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/qY7fQza' + cs
parms['ts'] = int(round(time.time() * 1000))
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url)
......
from numpy import long
from android_event.android_script import allEvent
import random
import requests
import socket
import struct
import time
import datetime
# 导入hashlib模块进行md5操作
import hashlib
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
parms = {
'click_time': str(round(time.time() * 1000)),
'idfa': '',
'idfa_MD5': '',
# 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287',
'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)',
# 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)
# android
# Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36
}
def send_requestandroid(hc):
url1 = 'http://52.80.137.106:8083/tkio/3u63Uza?noredirect=true' + hc
# url1 = 'https://uri6.com/tkio/Q3um6na?noredirect=true' + hc
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.text)
print(url1)
return response
import requests
import time
import json
import socket
import struct
import random
import hashlib
data = {
"what": "install",
"appid": "7f43b32bad452c092096136c9be73d09",
"context": {
"_deviceid": "",
"_idfa": "",
"_idfv": "",
"_ip": "",
"_manufacturer": "vivo",
"_ryos": "ios",
"_rydevicetype": "vivox9",
"_networktype": "5g",
"_resolution": "1344*750",
"_carrier": "111",
"_timestamp": 1655291783782,
"_model": "jixing",
"_ryosversion": "13.6.1",
"__model": "jixing"
},
"when": int(round(time.time() * 1000)),
"ds": "2022-06-15",
"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://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 test_se1():
data["appid"] = "16dc0cb882d3dbec4f7f66251a84d6dd"
send_request()
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