Commit 1caec78b by zhaihuitao

添加生产环境配置信息

parent d4610f67
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: analysis.py
@time: 2020/8/4 14:12
@desc: analysis yaml
"""
import yaml
with open('/Users/zhaihuitao/gitlab/trackingIO/config/prod/prod.yaml', 'r+', encoding='utf-8') as f:
config = yaml.load(f)
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: __init__.py.py
@time: 2020/8/4 13:53
@desc:
"""
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: click.py
@time: 2020/8/4 13:56
@desc: android click
"""
import random
import requests
import socket
import struct
import config.analysis
import config.prod
import time
# 向短链发送点击数据
# !!!!分包需要删掉https的s
event = 'event_12'
cmpaignid = '3333'
# 广告创意ID
ry_adcreative_id = '999'
# 广告组ID
ry_adgroup_id = '999'
# 广告计划ID
ry_adplan_id = '999'
# 广告组名称
ry_adgroup_name = '广告组'
# 广告计划名称
ry_adplan_name = '广告计划'
# 广告创意名称
ry_adcreative_name = '广告创意'
s = 0
w = 0
#print(config['click']['url'])
for _ in range(1):
#随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '167070728336'
#随机生成ip
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# ip = '175.93.28.70'
try:
parms = {
# 'androidid': "43214532142142",
'imei': i,
# "idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
'ip': ip,
# "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko)
# Version/5.1 Mobile/9A334 Safari/7534.48.3", 'creativeId':'21321321312123', 'requestId':'312321321312',
# 'adId': long('21231'), 'ry_adgroup_name': ry_adgroup_name, 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name': ry_adcreative_name,
"ry_adgroup_id": ry_adgroup_id,
"ry_adplan_id": ry_adplan_id,
"ry_adcreative_id": ry_adcreative_id,
}
#timeout可以超时四秒
# verify = False
p = requests.get(url=config['click']['url'], params=parms, timeout=30, verify= False)
print('success:',s)
# print(p.text)
print('imei:',i)
#print('ip:',ip)
s=s+1
except requests.exceptions.RequestException:
print('wrong:',w)
print('imei:', i)
print('ip', ip)
w=w+1
continue
# time.sleep(7)
# try:
# allEvent().installUpload(i, ip, appkey, cmpaignid)
# except Exception as err:
# print('install_wrong:', w)
# w = w + 1
# print(err)
# time.sleep(1)
# try:
# allEvent().registerEvent(i, ip, appkey)
# except Exception as e:
# print('注册_wrong:', w)
# print(e)
# # continue
# time.sleep(2)
# try:
# allEvent().loginEvent(i, ip, appkey)
# except Exception:
# print('登录_wrong:', w)
# time.sleep(5)
# try:
# allEvent().payEvent(i, ip, appkey)
# except Exception:
# print('付费_wrong:', w)
# time.sleep(2)
# try:
# allEvent().ziding_event(i, ip, appkey,event)
# except Exception:
# print('自定义_wrong:', w)
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