Commit e9d4e95a by zhaihuitao

添加配置地址

parent 07c35ef3
......@@ -6,3 +6,514 @@
@desc:
"""
class allEvent:
# 激活
def installUpload(self, i, IP, appkey):
s = json.dumps({
# "what":'install',
"appid": appkey,
"context": {
"_carrier": carrier,
"_network_type": network_type,
"_ryosversion": ryosversion,
"_model": model,
"_pkgname": "com.yanjing.yami",
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
# "_androidid": "43214532142142",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '234B9U1T-A274-ED22-CEBF-4B6DDDFC18A9',
# '_mac': "12321321321321321",
"_istablet": istablet,
"_lib": lib,
"_lib_version": lv,
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'install', data=s, headers=headers, timeout=5)
print("激活:" + p.text)
print("设备id:" + i)
print(p.url)
except Exception as err:
print(err)
# 今日头条归因
def formevent(self, i, IP, appkey):
s = json.dumps({
"appid": appkey,
"context": {
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_imei2":i,
# "_oaid":i,
# "_meid":i,
"_androidid": "2342312",
"_ip": IP,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
"_lib_version": lv,
'_timestamp': "aaa"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
# 'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL + 'form', data=s, headers=headers, timeout=10)
print("今日头条表单" + p.text)
# 启动
def startupEvent(self, i, IP, appkey):
s = json.dumps(
{
# 'what': 'startup',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
"_lib_version": lv,
# "_campaignid": 'default',
# "_deviceid": i,
# "_imei": i,
# # "_idfa": '75463565745634546',
# "_androidid": "424653325643",
# # "_imei2":"324323AAAA",
# # "_meid": "CCC324323",
# "_ip": IP,
# # "_ipv6": i,
# '_manufacturer': manufacturer,
# '_ryos': ryos,
# '_rydevicetype': rydevicetype,
# '_network': network,
# '_resolution': resolution,
# '_op': op,
# '_timestamp': current_time_13,
# '_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# # '_mac':"565354131606"
},
# 'when': when,
# 'ds': ds,
'who': 'lxx_test'
}
)
p = requests.post(url=URL + 'startup', data=s, headers=headers, timeout=10)
print("启动" + p.text)
print(when)
# 注册
def registerEvent(self, i, IP, appkey):
s = json.dumps({
# 'what':'register',
'appid': appkey,
'context': {
'_deviceid': i,
# '_imei':i,
# '_androidid':i,
'_ip': IP,
'_timestamp': current_time_13,
'_oaid': i,
"_lib_version": lv,
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL + 'register', data=s, headers=headers, timeout=10)
# print("注册时间戳"+current_time_13)
print("注册" + p.text)
# 登陆
def loginEvent(self, i, IP, appkey):
s = json.dumps({
# 'what': 'loggedin',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_ryos': ryos,
"_lib_version": lv,
# '_rydevicetype': rydevicetype,
'_timestamp': current_time_13
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'loggedin', data=s, headers=headers, timeout=10)
print("登录" + p.text)
except Exception as err:
print(err)
# 付费
def payEvent(self, i, IP, appkey):
# 订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({
# 'what': 'payment',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
'_transactionid': transactionid,
'_paymenttype': paymenttype,
'_ryos': ryos,
'_currencytype': currencytype,
'_currencyamount': currencyamount,
"_lib_version": lv,
'_oaid': "unknow"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL + 'payment', data=s, headers=headers, timeout=5)
print("付费" + p.text)
# print(str(s))
# 订单
def payorder(self, i, IP, appkey):
# 订单号
transactionid = ''.join(str(random.choice(range(10))) for _ in range(19))
s = json.dumps({
'what': 'order',
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_timestamp': current_time_13,
'_transactionid': transactionid,
'_paymenttype': paymenttype,
"_lib_version": lv,
'_currencytype': currencytype,
'_ryos': ryos,
'_currencyamount': currencyamount,
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL + 'order', data=s, headers=headers, timeout=5)
print("订单" + p.text)
# 自定义事件
def ziding_event(self, i, IP, appkey, event):
s = json.dumps({
'what': event,
'appid': appkey,
'context': {
'_deviceid': i,
'_imei': i,
'_androidid': i,
'_ip': IP,
'_ryos': ryos,
"_lib_version": lv,
# 识别是否为自定义事件,默认传1
'_isreyundefaultevent': '1'
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=5)
print("自定义" + p.text)
# 自定义事件
def invoke_test(self, i, IP, appkey):
s = json.dumps({
"what": "invoke",
"appType": "",
"appid": appkey,
"context": {
"_campaignid": "_default_",
"_rydevicetype": "iPhone",
"_ip": IP,
"_ryosversion": ryosversion,
"_manufacturer": "苹果",
"frequency": "0.000",
"_app_version": "2.0",
"_isreyundefaultevent": "1",
"_deviceid": i,
"_device_gps": "unknown",
"_jbk": "0",
"_timestamp": "1565941809351",
"_imei": i,
# "_idfa": "DBC43622-E34B-440C-B7A7-FB6641D0D9AB",
"_idfv": i,
"_lib_version": lv,
"_carrier": carrier,
"_ry_ts": "1565941809416",
"_create_timestamp": "1565941809351",
"_tz": "+8",
"_pkgname": "com.reyun.sdktrackingtest",
"_ipv6": "fe80::1cf8:ea60:3508:1dc2",
"modify": "0",
"_ry_origin_when": "2019-08-16 15:50:09",
"_resolution": "736*414",
"_ryos": "ios",
"_model": model,
"_mac": "02:00:00:00:00:00",
"_network_type": "WIFI",
"_lats": "1"
},
"where": "event",
# "when": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# "ds": ds,
"who": "unknown"
})
p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=5)
print("自定义" + p.text)
# 广告展示
def adshow(self, i, IP, appkey, adid):
s = json.dumps({
"appid": appkey,
"context": {
'_adPlatform': adPlatform,
'_adId': adid,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7',
"_fill": "1",
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'adshow', data=s, headers=headers, timeout=5)
print("广告展示:" + p.text)
print("设备id:" + i)
except Exception as err:
print(err)
# 广告点击
def adclick(self, i, IP, appkey, adid):
s = json.dumps({
"appid": appkey,
"context": {
'_adPlatform': adPlatform,
'_adId': adid,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'adclick', data=s, headers=headers, timeout=5)
print("广告点击:" + p.text)
print("设备id:" + i)
except Exception as err:
print(err)
# App页面浏览时长分布
def pageduration(self, i, IP, appkey, sessionID, pageId):
s = json.dumps({
"appid": appkey,
"context": {
'_pageid': pageId,
"_sessionid": sessionID,
'_pageduration': pageduration,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'pageduration', data=s, headers=headers, timeout=5)
print("App页面浏览时长分布:" + p.text)
except Exception as err:
print(err)
# App使用时长
def appduration(self, i, IP, appkey, sessionID):
s = json.dumps({
"appid": appkey,
"context": {
"_appduration": appduration,
"_sessionid": sessionID,
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
# "_ipv6": i,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
'_timestamp': current_time_13,
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
})
try:
p = requests.post(url=URL + 'appduration', data=s, headers=headers, timeout=5)
print("App使用时长:" + p.text)
except Exception as err:
print(err)
# 批量上传数据接口
def batchUpload(self, i, IP, appkey):
s = json.dumps(
{"from": "tkio", "data": [
{"appid": appkey, "when": "2018-01-08 11:22:42", "what": "startup",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": "1515381771925", "_create_timestamp": "1515381762624",
"_rydevicetype": "iPhone", "_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "unknown"},
{"appid": appkey, "when": "2018-01-08 11:22:42", "what": "register",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": "1515381771925", "_create_timestamp": "1515381762657",
"_rydevicetype": "iPhone", "_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "acc1"},
]}
)
p = requests.post(url=URL_batch, data=s, headers=headers, timeout=5)
print("自定义" + p.text)
# h5
def H5(self, i, IP, appkey):
s = json.dumps({
"what": "download",
"appType": "wap",
"appid": appkey,
"context": {
"_campaignid": "_default_",
"_deviceid": i,
"_cid": "-1",
"_ry_ts": "1588130655311",
"_tz": "+8",
"_ip": IP,
"_apptype": "wap",
"_campaignid_bak": "_default_",
"_ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36",
"_cid_bak": "-1"
},
"where": "event",
"deviceid": i,
"when": when,
"ds": ds,
"who": "552317006484"
})
try:
p = requests.post(url=URL + 'event', data=s, headers=headers, timeout=5)
print("App使用时长:" + p.text)
except Exception as err:
print(err)
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