Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tkio-test-case
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuxiaoxing
tkio-test-case
Commits
469433c8
Commit
469433c8
authored
Feb 22, 2023
by
liuxiaoxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日常迭代
parent
09e8ad69
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
339 additions
and
89 deletions
+339
-89
click.py
android_click/click.py
+19
-15
android_script.py
android_event/android_script.py
+1
-1
android_fenlianjie.py
android_event_case/android_fenlianjie.py
+2
-2
click.py
fenbao_android_click/click.py
+2
-2
click.py
ios_click/click.py
+0
-3
attributioncase.py
microservices/attributioncase.py
+40
-15
attributioncaseios.py
microservices/attributioncaseios.py
+1
-1
createMD5_tenjinId.py
microservices/createMD5_tenjinId.py
+20
-0
receiveandroid.py
microservices/receiveandroid.py
+9
-10
receiveios.py
microservices/receiveios.py
+1
-1
redirectandroid.py
microservices/redirectandroid.py
+3
-2
redirectios.py
microservices/redirectios.py
+1
-1
attributioncaseandroid.py
tkio/attributioncaseandroid.py
+2
-2
clickandroid.py
tkio/clickandroid.py
+1
-1
clickios.py
tkio/clickios.py
+1
-1
tkioreceive.py
tkio/tkioreceive.py
+2
-2
x_launch.py
xiaochengxu/x_launch.py
+169
-30
xiaochenxu_script.py
xiaochengxu/xiaochenxu_script.py
+65
-0
No files found.
android_click/click.py
View file @
469433c8
...
...
@@ -52,8 +52,8 @@ ry_adplan_name = 'c测试1'
ry_adcreative_name
=
'c测试1'
# bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销
pid
=
'rryingxiao_int'
# URL = 'http://uri6.com/tkio/ry2MN3a?order_id=987688761&demand_id=987688761&itemid=987688761&
noredirect=true'
URL
=
'http://52.80.137.106:8083/tkio/3Qz2Ufa?noredirect=true'
URL
=
'http://uri6.com/tkio/VZZ7Ffa?
noredirect=true'
#
URL = 'http://52.80.137.106:8083/tkio/3Qz2Ufa?noredirect=true'
# 测试头条衍生事件回调时加上
# callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D
...
...
@@ -146,8 +146,12 @@ for index in range(1):
"ry_adgroup_id"
:
ry_adgroup_id
,
"ry_adplan_id"
:
ry_adplan_id
,
"ry_adcreative_id"
:
ry_adcreative_id
,
# 巨量2.0
# "project_id":proiect_id,
# "advert_id":advert_id,
# # "project_name": proiect_name,
# # "advert_name": advert_name,
# # # # # # 账户id
...
...
@@ -217,14 +221,14 @@ for index in range(1):
# print('androidid', a)
w
=
w
+
1
#
time.sleep(6)
#
try:
#
allEvent().installUpload(i, ip, appkey)
#
# allEvent().formevent(i, ip, appkey)
#
#
except Exception:
#
print('install_wrong:', w)
#
w = w + 1
time
.
sleep
(
6
)
try
:
allEvent
()
.
installUpload
(
i
,
ip
,
appkey
)
# allEvent().formevent(i, ip, appkey)
except
Exception
:
print
(
'install_wrong:'
,
w
)
w
=
w
+
1
# # # # #
# # # # #
...
...
@@ -248,11 +252,11 @@ for index in range(1):
# allEvent().loginEvent(i, ip, appkey)
# except Exception:
# print('登录_wrong:', w)
#
time.sleep(3)
#
try:
#
allEvent().payEvent(i, ip, appkey)
#
except Exception as err:
#
print(err)
time
.
sleep
(
3
)
try
:
allEvent
()
.
payEvent
(
i
,
ip
,
appkey
)
except
Exception
as
err
:
print
(
err
)
# print('付费_wrong:', w)
# time.sleep(3)
# try:
...
...
android_event/android_script.py
View file @
469433c8
...
...
@@ -40,7 +40,7 @@ paymenttype = 'alipay'
# 货币类型
currencytype
=
'CNY'
# 支付的货币金额
currencyamount
=
'90
.3455
'
currencyamount
=
'90'
# # 填充广告在变现平台的广告位ID
# adid = '839296815'
# 填充广告的变现平台,例如穿山甲(csj)、优量汇(ylh)、百青藤(bqt)、Sigmob(sigmob)、快手(ks)、Mintegral(mintegral)、OneWay(oneway)、Vungle(vungle)等
...
...
android_event_case/android_fenlianjie.py
View file @
469433c8
...
...
@@ -10,7 +10,7 @@ import hashlib
#安卓常规渠道激活
appkey
=
'
7f43b32bad452c092096136c9be73d09
'
appkey
=
'
d58151cfff3f88b7fd3372fa5f596b44
'
# 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd
...
...
@@ -52,7 +52,7 @@ for index in range(1):
# 海市
# 119.60.0.0 宁夏回族自治区银川市
# start_time = time.time()
#
allEvent().installUpload(i, ip, appkey)
allEvent
()
.
installUpload
(
i
,
ip
,
appkey
)
# # print("time===>",(time.time()-start_time))
# # time.sleep(1)
# allEvent().startupEvent(i, ip, appkey)
...
...
fenbao_android_click/click.py
View file @
469433c8
...
...
@@ -8,8 +8,8 @@ import time
#向短链发送点击数据
#!!!!分包需要删掉https的s
# URL = 'http://uri6.com/tkio/fUf6ju
a?noredirect=true'
URL
=
'http://52.80.137.106:8083/tkio/2yyEnua?noredirect=true'
URL
=
'http://uri6.com/tkio/ai6naa
a?noredirect=true'
#
URL = 'http://52.80.137.106:8083/tkio/2yyEnua?noredirect=true'
appkey
=
'16dc0cb882d3dbec4f7f66251a84d6dd'
# event = 'invoke'
...
...
ios_click/click.py
View file @
469433c8
...
...
@@ -69,8 +69,6 @@ for _ in range(1):
# 'idfa_MD5': computeMD5upper(i),
# 'idfv': 'IFV_64F5A794-A942-4209-81B0-D28FD01E9287',
# 'muid':i,
# 'oaid':'654324352124312232',
# 'oaid_MD5': 'FCAF473729CE701E95A9422F5FBCD607',
'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
...
...
@@ -83,7 +81,6 @@ for _ in range(1):
"ry_adgroup_id"
:
ry_adgroup_id
,
"ry_adplan_id"
:
ry_adplan_id
,
"ry_adcreative_id"
:
ry_adcreative_id
,
# 'mac': mac
}
# timeout可以超时四秒
p
=
requests
.
get
(
url
=
URL
,
params
=
parms
,
timeout
=
4
,
verify
=
False
)
...
...
microservices/attributioncase.py
View file @
469433c8
...
...
@@ -178,7 +178,7 @@ def test_atb1():
i
=
code_nums
(
12
)
redirectandroid
.
parms
[
'oaid'
]
=
i
redirectandroid
.
send_request3
(
''
)
time
.
sleep
(
5
)
time
.
sleep
(
10
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'oaid'
...
...
@@ -1544,16 +1544,16 @@ def test_impatb16():
# 单独的点击
def
test_click
():
i
=
code_nums
(
12
)
redirectandroid
.
parms
[
'touchpoint_type'
]
=
'impression'
redirectandroid
.
parms
[
'oaid'
]
=
'90tg5ut753a2'
#
redirectandroid.parms['touchpoint_type'] = 'impression'
redirectandroid
.
parms
[
'oaid'
]
=
i
redirectandroid
.
send_request3
(
''
)
print
(
i
)
# 单独的激活
def
test_install
():
# i = '23A051-DB2A-4F4F-9154-BC15EF565752
'
i
=
code_nums
(
12
)
i
=
'90tg5ut753a21
'
#
i = code_nums(12)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'oaid'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'oaid'
...
...
@@ -1564,20 +1564,20 @@ def test_install():
# 单独的点击
def
test_click
():
i
=
code_nums
(
12
)
# redirectandroid.parms['touchpoint_type'] = 'impression'
redirectandroid
.
parms
[
'gaid'
]
=
'9C3FA000-DB2A-4F4F-9154-BC15EF565772'
# redirectandroid.parms['ts'] = '1668997850000'
redirectandroid
.
send_request3
(
''
)
print
(
i
)
# def test_click1
():
#
i = code_nums(12)
#
# redirectandroid.parms['touchpoint_type'] = 'impression'
#
redirectandroid.parms['gaid'] = '9C3FA000-DB2A-4F4F-9154-BC15EF565772'
#
# redirectandroid.parms['ts'] = '1668997850000'
#
redirectandroid.send_request3('')
#
print(i)
def
test_atbgoogle
():
i
=
code_nums
(
36
)
# i = '9C3FA051-DB0A-4F4F-1004-BC15EF565787
'
receiveandroid
.
data
[
0
][
'timestamp_info'
][
'current_event_time'
]
=
'16
68847756
000'
#
i = code_nums(36)
i
=
'9C3FA051-DB2A-4F4F-0011-BC15EF565121
'
receiveandroid
.
data
[
0
][
'timestamp_info'
][
'current_event_time'
]
=
'16
75996225
000'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'imei1'
]
=
''
receiveandroid
.
data
[
0
][
'device_info'
][
'gaid'
]
=
i
...
...
@@ -1585,6 +1585,31 @@ def test_atbgoogle():
receiveandroid
.
data
[
0
][
'device_info'
][
'os'
]
=
'1'
receiveandroid
.
data
[
0
][
'device_info'
][
'os_version'
]
=
'1.0'
receiveandroid
.
send_requestgoogle
()
time
.
sleep
(
20
)
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'gaid'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'gaid'
receiveandroid
.
data
[
0
][
"event_info"
][
'event_name'
]
=
'purchase'
receiveandroid
.
data
[
0
][
"event_info"
][
'event_type'
]
=
'preset'
receiveandroid
.
data
[
0
][
'timestamp_info'
][
'current_event_time'
]
=
'1675996225000'
receiveandroid
.
data
[
0
][
"event_info"
][
"event_data"
][
'order_amount'
]
=
"0"
receiveandroid
.
send_requestgoogle
()
print
(
i
)
def
test_atbopen
():
# i = code_nums(36)
i
=
'9C3FA051-DB2A-4F4F-0001-BC15EF565120'
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'gaid'
]
=
i
receiveandroid
.
data
[
0
][
'device_info'
][
'device_id_type'
]
=
'gaid'
receiveandroid
.
data
[
0
][
"event_info"
][
'event_name'
]
=
'custom'
# custom
receiveandroid
.
data
[
0
][
"event_info"
][
'event_type'
]
=
'open'
# receiveandroid.data[0]['timestamp_info']['current_event_time'] = '1668847756000'
receiveandroid
.
data
[
0
][
"event_info"
][
"event_data"
][
'order_amount'
]
=
"0"
receiveandroid
.
send_requestgoogle
()
print
(
i
)
...
...
microservices/attributioncaseios.py
View file @
469433c8
...
...
@@ -100,7 +100,7 @@ def test_atb3():
redirectios
.
parms
[
'idfa'
]
=
i
redirectios
.
parms
[
'idfa_md5'
]
=
computeMD5
(
i
)
redirectios
.
send_request3
(
''
)
time
.
sleep
(
1
)
time
.
sleep
(
2
)
receiveios
.
data
[
0
][
'device_info'
][
'idfa'
]
=
i
receiveios
.
data
[
0
][
'device_info'
][
'idfa_md5'
]
=
computeMD5
(
i
)
receiveios
.
data
[
0
][
'device_info'
][
'idfv'
]
=
v
...
...
microservices/createMD5_tenjinId.py
0 → 100644
View file @
469433c8
import
hashlib
def
computeMD5
(
message
):
m
=
hashlib
.
md5
()
m
.
update
(
message
.
encode
(
encoding
=
'utf-8'
))
return
m
.
hexdigest
()
id1
=
'9C3FA051-DB2A-4F4F-0011-BC15EF565121'
+
'lxx-test20230214'
+
'install'
+
'1675996225000'
# id2 ='9C3FA051-DB2A-4F4F-9154-BC15EF565104'+'lxx-test20230214'+'install'+'1668847756000'
# id3 ='9C3FA051-DB2A-4F4F-9154-BC15EF565104'+'lxx-test20230214'+'install'+'1668847756000'
tenjin_id1
=
computeMD5
(
id1
)
.
upper
()
# tenjin_id2 = computeMD5(id1).upper()
# tenjin_id3 = computeMD5(id1).upper()
print
(
tenjin_id1
)
# print(tenjin_id2)
# print(tenjin_id3)
\ No newline at end of file
microservices/receiveandroid.py
View file @
469433c8
...
...
@@ -46,8 +46,8 @@ global data
data
=
[
{
"application_info"
:
{
"appkey"
:
"
34423435
4"
,
"bundleid"
:
"
grere34543f4r4
"
,
"appkey"
:
"
lxx-test2023021
4"
,
"bundleid"
:
"
987654321
"
,
# www.jd111.com
"app_version"
:
"1"
,
"channel_name"
:
"google"
...
...
@@ -100,7 +100,7 @@ data = [
"register_type"
:
"WeChat"
,
"login_type"
:
"Wechat"
,
"order_id"
:
"2341242342676398724"
,
"order_amount"
:
"30"
,
#
"order_amount": "30",
"currency_type"
:
"CNY"
,
"purchase_type"
:
"Alipay"
,
"ad_platform"
:
"csj"
,
...
...
@@ -138,10 +138,10 @@ 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"
#
data[0]['timestamp_info']['install_time'] = int(round(time.time() * 1000))
#
url = "http://tkio-receive.solar-engine.com/receive/tkiov2/sdk"
data
[
0
][
'timestamp_info'
][
'install_time'
]
=
int
(
round
(
time
.
time
()
*
1000
))
print
(
data
)
response
=
requests
.
request
(
"POST"
,
url
,
headers
=
headers
,
data
=
json
.
dumps
(
data
))
...
...
@@ -193,9 +193,9 @@ def send_requestgoogle():
# 对接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"
print
(
data
)
response
=
requests
.
request
(
"POST"
,
url
,
headers
=
headers
,
data
=
json
.
dumps
(
data
))
...
...
@@ -1255,12 +1255,11 @@ def test_event_name2():
for
event
in
newList
:
data
[
0
][
"event_info"
][
'event_name'
]
=
event
data
[
0
][
"event_info"
][
'event_type'
]
=
"custom"
response
=
send_request
()
assert
response
[
"status"
]
==
"0"
# event_type为preset,event为自定义事件
# event_type为preset
(预置)
,event为自定义事件
def
test_event_name3
():
# lst = []
newList
=
[
'222'
,
'wwqeWEW'
,
'We2_32e'
]
...
...
microservices/receiveios.py
View file @
469433c8
...
...
@@ -42,7 +42,7 @@ global data
data
=
[
{
"application_info"
:
{
"appkey"
:
"
222
"
,
"appkey"
:
"
a75815182d534cb0
"
,
"bundleid"
:
"3423232"
,
"app_version"
:
"1"
,
"channel_name"
:
"default"
...
...
microservices/redirectandroid.py
View file @
469433c8
...
...
@@ -144,9 +144,10 @@ def send_request2():
def
send_request3
(
cs
):
global
parms
# 测试
# url1 = 'http://tmtest.trackingio.com/receive/turl/myyAJza' + cs
# QzIBnya
url1
=
'http://tmtest.trackingio.com/receive/turl/QzIBnya'
+
cs
# 线上
url1
=
'http://tkio-redirect.solar-engine.com/receive/turl/aie6vya'
+
cs
#
url1 = 'http://tkio-redirect.solar-engine.com/receive/turl/aie6vya' + cs
parms
[
'ts'
]
=
int
(
round
(
time
.
time
()
*
1000
))
# parms['ts'] = int(round(time.time()))
...
...
microservices/redirectios.py
View file @
469433c8
...
...
@@ -106,7 +106,7 @@ def send_request3(cs):
# 测试
# url1 = 'http://tmtest.trackingio.com/receive/turl/vMjIBza' + cs
# 线上
url1
=
'http://tkio-redirect.solar-engine.com/receive/turl/
6Z3Yry
a'
+
cs
url1
=
'http://tkio-redirect.solar-engine.com/receive/turl/
AvEj6b
a'
+
cs
parms
[
'ts'
]
=
int
(
round
(
time
.
time
()
*
1000
))
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
url
)
...
...
tkio/attributioncaseandroid.py
View file @
469433c8
...
...
@@ -153,8 +153,8 @@ def test_oaid1():
clickandroid
.
parms
[
'mac'
]
=
mac
clickandroid
.
parms
[
'muid'
]
=
''
clickandroid
.
parms
[
'ip'
]
=
ip
#
clickandroid.send_requestandroid('')
clickandroid
.
send_requestandroid
(
'&preorder=true'
)
clickandroid
.
send_requestandroid
(
''
)
#
clickandroid.send_requestandroid('&preorder=true')
time
.
sleep
(
5
)
tkioreceiveandroid
.
data
[
'context'
][
'_deviceid'
]
=
i
...
...
tkio/clickandroid.py
View file @
469433c8
...
...
@@ -35,7 +35,7 @@ parms = {
def
send_requestandroid
(
hc
):
# url1 = 'http://52.80.137.106:8083/tkio/MfyEzya?noredirect=true' + hc
url1
=
'http://uri6.com/tkio/
bmEJre
a?noredirect=true'
+
hc
url1
=
'http://uri6.com/tkio/
jeAzqi
a?noredirect=true'
+
hc
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
text
)
print
(
url1
)
...
...
tkio/clickios.py
View file @
469433c8
...
...
@@ -33,7 +33,7 @@ parms = {
def
send_requestandroid
(
hc
):
# url1 = 'http://52.80.137.106:8083/tkio/VFnQFja?noredirect=true' + hc
url1
=
'http://uri6.com/tkio/
zArQRz
a?noredirect=true'
+
hc
url1
=
'http://uri6.com/tkio/
AvEj6b
a?noredirect=true'
+
hc
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
text
)
print
(
url1
)
...
...
tkio/tkioreceive.py
View file @
469433c8
...
...
@@ -42,9 +42,9 @@ data_temp = json.dumps(data)
def
send_request
():
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
))
print
(
data
)
response
=
requests
.
request
(
"POST"
,
url
,
headers
=
headers
,
data
=
json
.
dumps
(
data
))
...
...
xiaochengxu/x_launch.py
View file @
469433c8
...
...
@@ -4,28 +4,44 @@ import struct
import
random
import
time
import
requests
from
xiaochengxu
import
xiaochenxu_script
appkey
=
'afbb574bc0e1d7326fc92140399509ef
'
# appkey = 'e10a66c81e666da98b1ed781126dcbeb
'
# cid
cid
=
'21075'
#
cid = '21075'
# surl
surl
=
'MNreUfa'
# URL = 'http://52.80.137.106:8083/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
URL
=
'http://uri6.com/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
impressionid
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
requestid
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
s
=
0
for
index
in
range
(
5
):
# 随机生成12为数组
# i = ''.join(str(random.choice(range(10))) for _ in range(28))
i
=
'64532454323234223'
# 随机生成ip
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
# 打开
allEvent
()
.
openxiaochengxu
(
i
,
ip
,
cid
,
surl
,
appkey
,
impressionid
)
time
.
sleep
(
2
)
# surl = 'MNreUfa'
# URL = 'http://52.80.137.106:8083/tkio/ey67fua?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
# URL = 'http://uri6.com/tkio/Ur2MFra?noredirect=true&callback=www.baidu.com&request_id=111111&promoted_object_id=111'
# impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
# requestid = ''.join(str(random.choice(range(10))) for _ in range(12))
# s = 0
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
# 生成小写字母加数字组合
n
=
10
def
code_nums
(
n
=
6
):
ret
=
''
for
i
in
range
(
n
):
num
=
random
.
randint
(
0
,
9
)
letter
=
chr
(
random
.
randint
(
97
,
122
))
s
=
str
(
random
.
choice
([
num
,
letter
]))
ret
+=
s
return
ret
# for index in range(5):
# # 随机生成12为数组
# # i = ''.join(str(random.choice(range(10))) for _ in range(28))
# i = '64532454323234223'
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
#
# # 打开
# allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid)
# time.sleep(2)
# # # #pv
# # # allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# # # # # #离开
...
...
@@ -46,7 +62,6 @@ for index in range(5):
# i = ''.join(str(random.choice(range(10))) for _ in range(28))
# # i = '1761453021140876860117396099'
#
#
# # print("开始时间"+datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
# # 随机生成12为数组
# # impressionid = ''.join(str(random.choice(range(10))) for _ in range(12))
...
...
@@ -62,7 +77,7 @@ for index in range(5):
# 'click_time': str(round(time.time() * 1000)),
# # 'click_time': '1667308011000',
# # 'wechat_openid': i,
# 'click_id':'123456789',
# 'click_id':
'123456789',
# 'accountid': accountid,
# 'ip': ip,
# 'impression_id': impressionid,
...
...
@@ -95,14 +110,14 @@ for index in range(5):
# # print(p.status_code)
# # print('androidid', a)
# w = w + 1
#
time.sleep(2)
#
try:
#
allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid)
#
#
except Exception:
#
print('install_wrong:', w)
#
w = w + 1
#
#
time.sleep(2)
#
try:
#
allEvent().openxiaochengxu(i, ip, cid, surl, appkey, impressionid)
#
#
except Exception:
#
print('install_wrong:', w)
#
w = w + 1
# # pv
# time.sleep(2)
...
...
@@ -115,6 +130,130 @@ for index in range(5):
# time.sleep(2)
# allEvent().loggedinchengxu(i,ip,cid,surl,appkey)
# time.sleep(2)
allEvent
()
.
paymentchengxu
(
i
,
ip
,
cid
,
surl
,
appkey
)
#
allEvent().paymentchengxu(i, ip, cid, surl, appkey)
# time.sleep(2)
# allEvent().eventchengxu(i, ip, cid, surl, appkey)
parms
=
{
# 'click_time': str(round(time.time() * 1000)),
# 'click_time': '1676861385000',
# 'wechat_openid': i,
'click_id'
:
'123456789'
,
'accountid'
:
'111121'
,
'ip'
:
ip
,
'impression_id'
:
''
,
# 'request_id': requestid,
'_ry_adgroup_id'
:
'222'
,
'_ry_adplan_id'
:
"222"
,
'_ry_adcreative_id'
:
'222'
}
surl
=
'nEJ77za'
# Abmyuia
# zU7Z3ua
def
send_requestandroid
(
hc
):
# url1 = 'http://52.80.137.106:8083/tkio/' + surl + '?noredirect=true' + hc
url1
=
'http://uri6.com/tkio/'
+
surl
+
'?noredirect=true'
+
hc
response
=
requests
.
get
(
url
=
url1
,
params
=
parms
,
timeout
=
10
,
verify
=
False
)
print
(
response
.
text
)
print
(
url1
)
print
(
parms
)
return
response
def
test_click
():
i
=
code_nums
(
16
)
parms
[
'click_id'
]
=
i
send_requestandroid
(
''
)
time
.
sleep
(
3
)
xiaochenxu_script
.
data
[
'context'
][
'gdt_vid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_openid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_deviceid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_campaignid'
]
=
surl
xiaochenxu_script
.
data
[
'context'
][
'_cid'
]
=
'21059'
xiaochenxu_script
.
send_request
()
print
(
i
)
def
test_impressionid
():
i
=
code_nums
(
16
)
parms
[
'impression_id'
]
=
i
parms
[
'click_id'
]
=
'2132132'
send_requestandroid
(
''
)
time
.
sleep
(
3
)
xiaochenxu_script
.
data
[
'context'
][
'gdt_vid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_openid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_deviceid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_campaignid'
]
=
surl
xiaochenxu_script
.
data
[
'context'
][
'_cid'
]
=
'21059'
xiaochenxu_script
.
send_request
()
print
(
i
)
def
test_requestid
():
i
=
code_nums
(
16
)
parms
[
'request_id'
]
=
i
parms
[
'click_id'
]
=
'2132132'
send_requestandroid
(
''
)
time
.
sleep
(
3
)
xiaochenxu_script
.
data
[
'context'
][
'gdt_vid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_openid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_deviceid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_campaignid'
]
=
surl
xiaochenxu_script
.
data
[
'context'
][
'_cid'
]
=
'21059'
xiaochenxu_script
.
send_request
()
print
(
i
)
def
test_atb1
():
i1
=
code_nums
(
16
)
i2
=
code_nums
(
16
)
openid
=
code_nums
(
18
)
parms
[
'impression_id'
]
=
i1
parms
[
'click_id'
]
=
i2
send_requestandroid
(
''
)
time
.
sleep
(
3
)
xiaochenxu_script
.
data
[
'context'
][
'gdt_vid'
]
=
i1
xiaochenxu_script
.
data
[
'context'
][
'_openid'
]
=
i1
xiaochenxu_script
.
data
[
'context'
][
'_deviceid'
]
=
i1
xiaochenxu_script
.
data
[
'context'
][
'_campaignid'
]
=
surl
xiaochenxu_script
.
data
[
'context'
][
'_cid'
]
=
'21059'
xiaochenxu_script
.
send_request
()
time
.
sleep
(
3
)
xiaochenxu_script
.
data
[
'context'
][
'gdt_vid'
]
=
i2
xiaochenxu_script
.
data
[
'context'
][
'_openid'
]
=
i2
xiaochenxu_script
.
data
[
'context'
][
'_deviceid'
]
=
i2
xiaochenxu_script
.
data
[
'context'
][
'_campaignid'
]
=
surl
xiaochenxu_script
.
data
[
'context'
][
'_cid'
]
=
'21059'
xiaochenxu_script
.
send_request
()
print
(
i1
)
print
(
i2
)
def
test_launch
():
i
=
code_nums
(
16
)
xiaochenxu_script
.
data
[
'context'
][
'gdt_vid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_openid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_deviceid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_campaignid'
]
=
surl
xiaochenxu_script
.
data
[
'context'
][
'_cid'
]
=
'21059'
xiaochenxu_script
.
send_request
()
print
(
i
)
def
test_wg
():
i
=
code_nums
(
16
)
parms
[
'wechat_openid'
]
=
i
send_requestandroid
(
''
)
time
.
sleep
(
3
)
xiaochenxu_script
.
data
[
'context'
][
'gdt_vid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_openid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_deviceid'
]
=
i
xiaochenxu_script
.
data
[
'context'
][
'_campaignid'
]
=
surl
xiaochenxu_script
.
data
[
'context'
][
'_cid'
]
=
'21059'
xiaochenxu_script
.
data
[
'context'
][
'_apptype'
]
=
'wg'
xiaochenxu_script
.
data
[
'appid'
]
=
'1cb67e8beb1fe0d5a9c000f6f05b58e5'
xiaochenxu_script
.
send_request
()
print
(
i
)
xiaochengxu/xiaochenxu_script.py
View file @
469433c8
...
...
@@ -2,6 +2,10 @@ import requests
import
json
import
time
import
random
import
socket
import
struct
headers
=
{
'Content-Type'
:
'application/json'
}
# 测试环境
...
...
@@ -30,6 +34,8 @@ currencyamount = '45'
# 是否热云默认,标记为自定义事件
isreyundefaultevent
=
''
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
class
allEvent
:
# 打开小程序
...
...
@@ -224,3 +230,61 @@ class allEvent:
})
p
=
requests
.
post
(
url
=
URL
,
data
=
s
,
headers
=
headers
,
timeout
=
5
)
print
(
p
.
text
)
data
=
{
"what"
:
"launch"
,
"appid"
:
'30a90f0b0cfbde59b206bb046540a17f'
,
"context"
:
{
"_cid"
:
''
,
"_ip"
:
ip
,
"_deviceid"
:
'222'
,
"_openid"
:
'2222'
,
"_campaignid"
:
''
,
"_sceneid"
:
"434444"
,
"gdt_vid"
:
''
,
"_ry_adgroup_id"
:
"111"
,
"_ry_adplan_id"
:
"111"
,
"_ry_adcreative_id"
:
"111"
,
"accountid"
:
"123456"
,
# 投放广告详情-头条
# "advertiser_id": "333",
# "ad_id": "333",
# "creative_id": "333",
# "project_id": "333",
# "advert_id": "333",
"_apptype"
:
"wx"
},
"where"
:
"launch"
,
# "when": when,
"ds"
:
ds
,
"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://52.80.137.106:8080/receive/tkio/event"
# 线上
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
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment