1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import requests
import json
import time
import random
URL = 'http://log.reyun.com'
# URL = 'http://10.3.20.42:8080'
headers = {'Content-Type': 'application/json'}
URL_install = URL+'/receive/rest/install'
URL_startup = URL+'/receive/rest/startup'
URL_register = URL+'/receive/rest/register'
URL_payment = URL+'/receive/rest/payment'
URL_loggedin = URL+'/receive/rest/loggedin'
URL_event = URL+'/receive/rest/event'
URL_economy = URL+'/receive/rest/economy'
network = 'wifi'
os = 'ios'
devicetype = 'iphone4s'
resolution = '123*456'
channelid = '111'
op = '中国移动'
itemname = '测试5'
itemtotalprice = '99'
serverid = 1
class allevent:
def event_install(self,i,appid):
s = json.dumps({
"appid": appid,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid
}
})
p = requests.post(url=URL_install,data=s,headers=headers,timeout=4)
print(p.text)
def event_startup(self,i,appid):
s = json.dumps({
"appid": appid,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid,
"network":network,
"os":os,
"devicetype":devicetype,
'resolution':resolution,
'op': op
}
})
p = requests.post(url=URL_startup,data=s,headers=headers,timeout=4)
print(p.text)
def event_register(self,i,appid):
s = json.dumps({
"appid": appid,
"who":i,
"context":
{
"deviceid": i,
#"idfa":i,
#"idfv":i,
"serverid": serverid,
"channelid":channelid
}
})
p = requests.post(url=URL_register, data=s, headers=headers, timeout=4)
print(p.text)
def event_login(self, i, appid):
s = json.dumps({
"appid": appid,
"who": i,
"context":
{
"deviceid": i,
# "idfa":i,
# "idfv":i,
"serverid": serverid,
"channelid": channelid
}
})
p = requests.post(url=URL_loggedin,data=s,headers=headers,timeout=4)
print(p.text)
def event_payment(self,i,appid,campId):
s = json.dumps({
"appid": appid,
"who":i,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid,
"transactionid":"12323232131321",
"paymenttype":"支付宝",
"currencytype":"CNY",
"currencyamount":"100",
"virtualcoinamount":"500",
"iapname":"test",
"iapamount":"3",
"campId":campId
}
})
p = requests.post(url=URL_payment,data=s,headers=headers,timeout=4)
print(p.text)
def event_event(self,i,appid,event):
s = json.dumps({
"appid": appid,
"who": i,
"what": event,
"context":
{
"deviceid": i,
# "idfa":i,
# "idfv":i,
"serverid": serverid,
"channelid": channelid
}
})
p = requests.post(url=URL_event, data=s, headers=headers, timeout=4)
print(p.text)
def event_economy(self,i,appid,campId):
s = json.dumps({
"appid": appid,
"who":i,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid,
"itemamount": "1",
"itemname": itemname,
"itemtotalprice": itemtotalprice,
"campId": campId
}
})
p = requests.post(url=URL_economy,data=s,headers=headers,timeout=4)
print(p.text)