Commit f68d5708 by liuxiaoxing

init

parent 443c541a
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="NewPython 3.7 (test)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (PythonProjects)" project-jdk-type="Python SDK" />
</project> </project>
\ No newline at end of file
...@@ -14,6 +14,5 @@ s = json.dumps({ ...@@ -14,6 +14,5 @@ s = json.dumps({
"appid":"1234557890" "appid":"1234557890"
}) })
p = requests.post(test_url,data=s) p = requests.post(test_url,data=s)
print(p) print(p)
\ No newline at end of file
# from .import clickparams # from .import clickparams
from microservices import clickparams
import socket import socket
import struct import struct
import random import random
...@@ -6,151 +7,155 @@ import random ...@@ -6,151 +7,155 @@ import random
import requests import requests
import json import json
URL = 'http://tmtest.trackingio.com/receive/turl/Yzuiuma' URL = 'http://tmtest.trackingio.com/receive/turl/Yzuiuma'
clickparams.parms_ios['os'] = 'android'
response = requests.get(url=URL, params=clickparams.parms.update(clickparams.parms_ios), timeout=10, verify=False)
print(clickparams.parms)
print(response.text)
s = 0 s = 0
w = 0 w = 0
for index in range(1): # for index in range(1):
# print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')) # # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
# 随机生成12为数组 # # 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12)) # i = ''.join(str(random.choice(range(10))) for _ in range(12))
# # i = '65453434546345' # # i = '65453434546345'
# o = ''.join(str(random.choice(range(10))) for _ in range(12)) # # o = ''.join(str(random.choice(range(10))) for _ in range(12))
# m = ''.join(str(random.choice(range(10))) for _ in range(12)) # # m = ''.join(str(random.choice(range(10))) for _ in range(12))
# se = ''.join(str(random.choice(range(10))) for _ in range(12)) # # se = ''.join(str(random.choice(range(10))) for _ in range(12))
# adid = ''.join(str(random.choice(range(10))) for _ in range(12)) # # adid = ''.join(str(random.choice(range(10))) for _ in range(12))
# # adid = '5011813780042235' # # # adid = '5011813780042235'
# p1 = ''.join(str(random.choice(range(10))) for _ in range(12)) # # p1 = ''.join(str(random.choice(range(10))) for _ in range(12))
# accountid = ''.join(str(random.choice(range(10))) for _ in range(12)) # # accountid = ''.join(str(random.choice(range(10))) for _ in range(12))
# accountid = '032273574734' # # accountid = '032273574734'
# p1 = '测试一下' # # p1 = '测试一下'
# "idfa": 'B5588C9C-4534-43FB-935D-F17C91622C83', # # "idfa": 'B5588C9C-4534-43FB-935D-F17C91622C83',
# "idfa": '00000000-0000-0000-0000-000000000000', # # "idfa": '00000000-0000-0000-0000-000000000000',
# sh1 = "track_click:"+appkey+":"+get_str_sha1_secret_str(i) # # sh1 = "track_click:"+appkey+":"+get_str_sha1_secret_str(i)
# print(sh1) # # print(sh1)
# i = '091508889907' # # i = '091508889907'
# md5加密 # # md5加密
# 创建md5对象 # # 创建md5对象
# m = hashlib.md5() # # m = hashlib.md5()
# b = i.encode(encoding='utf-8') # # b = i.encode(encoding='utf-8')
# m.update(b) # # m.update(b)
# str_md5 = m.hexdigest().upper() # # str_md5 = m.hexdigest().upper()
# print("md5加密:"+str_md5) # # print("md5加密:"+str_md5)
########### # # ##########
# md16加密(截取md5加密的字符串) # # # md16加密(截取md5加密的字符串)
# imei_16 = str_md5[8:24] # # imei_16 = str_md5[8:24]
# print("md16加密:"+imei_16) # # print("md16加密:"+imei_16)
#
# 随机生成ip # # 随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff))) # ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '156.119.456.199' # ip = '156.119.456.199'
try: # try:
parms = { # parms = {
# 触点传参时间。is_s2s=1时必传,0时选传。不同渠道有可能传多种格式,详见需求。限制32位字符内。短链传参。 # # 触点传参时间。is_s2s=1时必传,0时选传。不同渠道有可能传多种格式,详见需求。限制32位字符内。短链传参。
'ts': '2122132121', # 'ts': '2122132121',
# 集成方式。is_s2s=1为服务器上报触点,0为客户端上报触点。0或1时有不同的参数非空校验,详见需求。固定为0或1。都必传 # # 集成方式。is_s2s=1为服务器上报触点,0为客户端上报触点。0或1时有不同的参数非空校验,详见需求。固定为0或1。都必传
'is_s2s': '1', # 'is_s2s': '1',
# 操作系统。限制16字符内。都选传。短链传参。暂不与app_platform互相做校验。 # # 操作系统。限制16字符内。都选传。短链传参。暂不与app_platform互相做校验。
'os': 'ios', # 'os': 'ios',
# 设备型号。限制64字符内。都选传。短链传参。 # # 设备型号。限制64字符内。都选传。短链传参。
'model': '小米', # 'model': '小米',
# 用户公网IP v4版本。限制15字符内。is_s2s=1时都必传,0时都选传,0时优先取传参IP,未传参或传参报错时,取http header中的ip作为ipv4的值 # # 用户公网IP v4版本。限制15字符内。is_s2s=1时都必传,0时都选传,0时优先取传参IP,未传参或传参报错时,取http header中的ip作为ipv4的值
'ipv4': '1.1.1.1', # 'ipv4': '1.1.1.1',
# 用户公网IP v6版本。限制128字符内。都选传 # # 用户公网IP v6版本。限制128字符内。都选传
'ipv6': '1.1.1.1', # 'ipv6': '1.1.1.1',
# 用户代理信息。限制512字符内。is_s2s=1时都必传,0时都选传,0时优先取传参UA,未传参或报错时,取http header中的user agent作为ua的值 # # 用户代理信息。限制512字符内。is_s2s=1时都必传,0时都选传,0时优先取传参UA,未传参或报错时,取http header中的user agent作为ua的值
'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/37.0.0.0 MQQBrowser/7.3 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/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36',
# 监测短链id。固定7位。 # # 监测短链id。固定7位。
# 'turl_id': '3r5K1h9', # # 'turl_id': '3r5K1h9',
# 全部url参数。 # # 全部url参数。
# 'tkul_string': 'xxx', # # 'tkul_string': 'xxx',
# 触点类型。固定为click。都必传 # # 触点类型。固定为click。都必传
'touchpoint_type': 'click', # 'touchpoint_type': 'click',
# 归因类型。固定为ua(user acquirement新客获取) # # 归因类型。固定为ua(user acquirement新客获取)
'attribution_type': 'ua', # 'attribution_type': 'ua',
# 广告账户id。限制64字符内。都选传 # # 广告账户id。限制64字符内。都选传
'account_id': '', # 'account_id': '',
# 广告组id。限制64字符内。都选传 # # 广告组id。限制64字符内。都选传
'adgroup_id': '', # 'adgroup_id': '',
# 广告组名称。限制256字符内。都选传 # # 广告组名称。限制256字符内。都选传
'adgroup_name': '', # 'adgroup_name': '',
# 广告计划id。限制64字符内。都选传 # # 广告计划id。限制64字符内。都选传
'adplan_id': '', # 'adplan_id': '',
# 广告计划名称。限制256字符内。都选传 # # 广告计划名称。限制256字符内。都选传
'adplan_name': '', # 'adplan_name': '',
# 广告创意id。限制128字符内。都选传 # # 广告创意id。限制128字符内。都选传
'adcreative_id': '', # 'adcreative_id': '',
# 广告创意名称。限制256字符内。都选传 # # 广告创意名称。限制256字符内。都选传
'adcreative_name': '', # 'adcreative_name': '',
# 创意类型(例如大图、小图、视频等)。限制16字符内。都选传 # # 创意类型(例如大图、小图、视频等)。限制16字符内。都选传
'adcreative_type': '', # 'adcreative_type': '',
# 流量媒体id(例如巨量的今日头条、穿山甲、抖音等)。限制32字符内。都选传 # # 流量媒体id(例如巨量的今日头条、穿山甲、抖音等)。限制32字符内。都选传
'site_id': '', # 'site_id': '',
# 流量媒体名称(例如巨量的今日头条、穿山甲、抖音等)。限制128字符内。都选传 # # 流量媒体名称(例如巨量的今日头条、穿山甲、抖音等)。限制128字符内。都选传
'site_name': '', # 'site_name': '',
# 广告类型(例如开屏、信息流、搜索等)。限制32字符内。都选传。 # # 广告类型(例如开屏、信息流、搜索等)。限制32字符内。都选传。
'ad_type': '', # 'ad_type': '',
# 广告位id。限制64字符内。都选传 # # 广告位id。限制64字符内。都选传
'placement_id': '', # 'placement_id': '',
# 转化id。限制64字符内。都选传 # # 转化id。限制64字符内。都选传
'conversion_id': '', # 'conversion_id': '',
# 广告点击id。限制64字符内。都选传 # # 广告点击id。限制64字符内。都选传
'click_id': '', # 'click_id': '',
# 广告展示id。限制64字符内。都选传 # # 广告展示id。限制64字符内。都选传
'impression_id': '', # 'impression_id': '',
# 广告请求id。限制64字符内。都选传 # # 广告请求id。限制64字符内。都选传
'request_id': '', # 'request_id': '',
# 渠道回调id。限制256字符。都选传 # # 渠道回调id。限制256字符。都选传
'callback_id': 'EJiw267wvfQCGKf2g74ZIPD89-vIATAMOAFCIjIwMTkxMTI3MTQxMTEzMDEwMDI2MDc3MjE1MTUwNTczNTBIAQ==', # 'callback_id': 'EJiw267wvfQCGKf2g74ZIPD89-vIATAMOAFCIjIwMTkxMTI3MTQxMTEzMDEwMDI2MDc3MjE1MTUwNTczNTBIAQ==',
# 渠道回调地址。限制256字符。都选传 # # 渠道回调地址。限制256字符。都选传
'callback_url': 'http%3A%2F%2Ftracking.e.qq.com%2Fconv%3Fcb%3DMTIzYWJjNDU2ZGVm%26conv_id%3D12345678', # 'callback_url': 'http%3A%2F%2Ftracking.e.qq.com%2Fconv%3Fcb%3DMTIzYWJjNDU2ZGVm%26conv_id%3D12345678',
# 自定触点参数集合。都选传。 # # 自定触点参数集合。都选传。
'custom_params_1': '' , # 'custom_params_1': '' ,
# Android OAID原值。限制512字符内。Android选传,app_platform=ios时报错 # # Android OAID原值。限制512字符内。Android选传,app_platform=ios时报错
'oaid': '3DEA635F-B24F-434B-833F-4ED028FEAEEF', # 'oaid': '3DEA635F-B24F-434B-833F-4ED028FEAEEF',
# Android OAID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错 # # Android OAID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'oaid_md5': '8e488a40a17aed2f6752f51382a4eafc', # 'oaid_md5': '8e488a40a17aed2f6752f51382a4eafc',
# Android主卡IMEI原值。限制32字符内。Android选传,app_platform=ios时报错 # # Android主卡IMEI原值。限制32字符内。Android选传,app_platform=ios时报错
'imei1': i, # 'imei1': i,
# Android主卡IMEI原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错 # # Android主卡IMEI原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'imei1_md5': '8e488a40a17aed2f6752f51382a4eafc', # 'imei1_md5': '8e488a40a17aed2f6752f51382a4eafc',
# Android副卡IMEI原值。限制32字符内。Android选传,app_platform=ios时报错 # # Android副卡IMEI原值。限制32字符内。Android选传,app_platform=ios时报错
'imei2': '8342732742383', # 'imei2': '8342732742383',
# Android副卡IMEI原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错 # # Android副卡IMEI原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'imei2_md5': '8e488a40a17aed2f6752f51382a4eafc', # 'imei2_md5': '8e488a40a17aed2f6752f51382a4eafc',
# Google Advertising ID原值。固定36字符。Android选传,app_platform=ios时报错 # # Google Advertising ID原值。固定36字符。Android选传,app_platform=ios时报错
'gaid': 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0', # 'gaid': 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0',
# Google Advertising ID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错 # # Google Advertising ID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'gaid_md5': '8e488a40a17aed2f6752f51382a4eafc', # 'gaid_md5': '8e488a40a17aed2f6752f51382a4eafc',
# //MAC原值。固定17字符。Android选传,app_platform=ios时报错 # # //MAC原值。固定17字符。Android选传,app_platform=ios时报错
'mac': '', # 'mac': '',
# MAC原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错 # # MAC原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'mac_md5': '', # 'mac_md5': '',
# Android ID原值。固定16字符。Android选传,app_platform=ios时报错 # # Android ID原值。固定16字符。Android选传,app_platform=ios时报错
'android_id': '', # 'android_id': '',
# Android ID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错 # # Android ID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'android_id_md5': '', # 'android_id_md5': '',
} # }
# timeout可以超时四秒 # # timeout可以超时四秒
# verify = False # # verify = False
p = requests.get(url=URL, params=parms, timeout=10, verify=False) # p = requests.get(url=URL, params=parms, timeout=10, verify=False)
print('imei:', i) # print('imei:', i)
print("ip:", ip) # print("ip:", ip)
# print("accountid:", accountid) # # print("accountid:", accountid)
print(p.text) # print(p.text)
print(p.url) # print(p.url)
# print("oaid:",o) # # print("oaid:",o)
print('success:', s) # print('success:', s)
print(p.status_code) # print(p.status_code)
print(p.content) # print(p.content)
# print('androidid:',a) # # print('androidid:',a)
# print(nowTime) # # print(nowTime)
s = s + 1 # s = s + 1
except Exception as err: # except Exception as err:
print(err) # print(err)
print('wrong:', w) # print('wrong:', w)
print('imei:', i) # print('imei:', i)
print("ip:", ip) # print("ip:", ip)
# print(p.status_code) # # print(p.status_code)
# print('androidid', a) # # print('androidid', a)
w = w + 1 # w = w + 1
\ No newline at end of file \ No newline at end of file
...@@ -3,8 +3,6 @@ parms = { ...@@ -3,8 +3,6 @@ parms = {
'ts': '2122132121', 'ts': '2122132121',
# 集成方式。is_s2s=1为服务器上报触点,0为客户端上报触点。0或1时有不同的参数非空校验,详见需求。固定为0或1。都必传 # 集成方式。is_s2s=1为服务器上报触点,0为客户端上报触点。0或1时有不同的参数非空校验,详见需求。固定为0或1。都必传
'is_s2s': '1', 'is_s2s': '1',
# 操作系统。限制16字符内。都选传。短链传参。暂不与app_platform互相做校验。
'os': 'ios',
# 设备型号。限制64字符内。都选传。短链传参。 # 设备型号。限制64字符内。都选传。短链传参。
'model': '小米', 'model': '小米',
# 用户公网IP v4版本。限制15字符内。is_s2s=1时都必传,0时都选传,0时优先取传参IP,未传参或传参报错时,取http header中的ip作为ipv4的值 # 用户公网IP v4版本。限制15字符内。is_s2s=1时都必传,0时都选传,0时优先取传参IP,未传参或传参报错时,取http header中的ip作为ipv4的值
...@@ -62,8 +60,8 @@ parms = { ...@@ -62,8 +60,8 @@ parms = {
} }
parmsios = {
parms_ios = {
# 操作系统。限制16字符内。都选传。短链传参。暂不与app_platform互相做校验。 # 操作系统。限制16字符内。都选传。短链传参。暂不与app_platform互相做校验。
'os': 'ios', 'os': 'ios',
# iOS IDFA原值。固定为36字符 # iOS IDFA原值。固定为36字符
...@@ -74,7 +72,7 @@ parmsios = { ...@@ -74,7 +72,7 @@ parmsios = {
} }
parmsandroid = { parms_android = {
# Android OAID原值。限制512字符内。Android选传,app_platform=ios时报错 # Android OAID原值。限制512字符内。Android选传,app_platform=ios时报错
'oaid': '3DEA635F-B24F-434B-833F-4ED028FEAEEF', 'oaid': '3DEA635F-B24F-434B-833F-4ED028FEAEEF',
# Android OAID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错 # Android OAID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
...@@ -99,5 +97,4 @@ parmsandroid = { ...@@ -99,5 +97,4 @@ parmsandroid = {
'android_id': '', 'android_id': '',
# Android ID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错 # Android ID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'android_id_md5': '', 'android_id_md5': '',
} }
\ 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