Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
doc
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
zhangqianying
doc
Commits
df50e760
Commit
df50e760
authored
Apr 03, 2018
by
zhangdaying8780@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a doc
parents
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
0 deletions
+110
-0
click.py
click.py
+42
-0
click2.py
click2.py
+68
-0
test_doc.docx
test_doc.docx
+0
-0
No files found.
click.py
0 → 100644
View file @
df50e760
#!/user/bin/python
# -*- coding: utf8 -*-
import
requests
import
json
import
datetime
import
random
import
uuid
default_url
=
'ec2-54-223-170-25.cn-north-1.compute.amazonaws.com.cn'
port
=
'8080'
path
=
'/receive/tkio/event'
URL
=
'http://'
+
default_url
+
port
+
path
appid
=
'16dc0cb882d3dbec4f7f66251a84d6dd'
nowTime
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
headers
=
{
'Content-Type'
:
'application/json'
}
s
=
json
.
dumps
({
"appid"
:
appid
,
"context"
:
{
"_deviceid"
:
"5021FED7D1CEF374_1"
,
"_imei"
:
"5021FED7D1CEF374_1"
,
"_idfa"
:
"imei"
,
"_campaignid"
:
"ad18fbb2efcd4905a4a487927e297842"
,
"_ip"
:
"192.168.10.26"
,
"_androidid"
:
"imei"
},
"when"
:
nowTime
,
"who"
:
"zqy-test2"
,
"what"
:
"event_0"
})
event
=
[
'event_0'
,
'event_1'
,
'event_2'
,
'event_3'
,
'event_4'
,
'event_5'
,
'event_6'
,
'event_7'
,
'event_8'
,
'event_9'
,
'event_10'
,
'event_11'
,
'event_12'
,
'event_13'
]
for
index
in
range
(
len
(
event
)):
print
(
'当前:'
,
event
[
index
])
r
=
requests
.
post
(
url
=
URL
,
data
=
s
,
headers
=
headers
,
timeout
=
5
)
print
(
r
.
url
)
print
(
r
.
text
)
print
(
r
.
status_code
)
\ No newline at end of file
click2.py
0 → 100644
View file @
df50e760
#!/usr/bin/env python
# encoding: utf-8
"""
@author: zqy@reyun.com
"""
import
requests
import
time
import
json
class
TaskName
(
object
):
def
__init__
(
self
):
"""打印执行函数名"""
pass
def
__call__
(
self
,
func
):
def
_call
(
*
args
,
**
kw
):
print
(
func
.
__doc__
+
"@
%
s"
%
time
.
asctime
(
time
.
localtime
(
time
.
time
())))
return
func
(
*
args
,
**
kw
)
return
_call
class
AppEventNature
(
object
):
def
__init__
(
self
):
"""receive服务"""
self
.
host
=
"http://log.reyun.com"
self
.
path
=
"/receive/tkio"
self
.
headers
=
{
"Content-Type"
:
"application/json;charset=UTF-8"
}
self
.
appid
=
"b6a138247d136b49466108bc5d7ff406"
self
.
_deviceid
=
"ZQY_D1CEF374-K9"
self
.
_campaignid
=
"ad18fbb2efcd4905a4a487927e297842"
self
.
_ip
=
"113.211.641.187"
self
.
_channelname
=
"kanxiu_2"
self
.
_cid
=
"6043"
self
.
_imei
=
"ZQY_D1CEF374-K9"
self
.
_timestamp
=
1511339363000
self
.
who
=
"zqy"
self
.
when
=
"2017-11-22 16:29:23"
self
.
data
=
{
"appid"
:
self
.
appid
,
"context"
:
{
"_deviceid"
:
self
.
_deviceid
,
"_campaignid"
:
self
.
_campaignid
,
"_idfv"
:
self
.
_deviceid
,
"_idfa"
:
self
.
_deviceid
,
"_ip"
:
self
.
_ip
,
"_channelname"
:
self
.
_channelname
,
"_cid"
:
self
.
_cid
,
"_imei"
:
self
.
_imei
,
"_timestamp"
:
self
.
_timestamp
},
"who"
:
self
.
who
,
"when"
:
self
.
when
}
@TaskName
()
def
action
(
self
,
eventName
):
"""基础请求"""
url
=
self
.
host
+
self
.
path
+
"/"
+
eventName
data
=
self
.
data
r
=
requests
.
post
(
headers
=
self
.
headers
,
url
=
url
,
data
=
json
.
dumps
(
data
))
print
(
r
.
text
)
\ No newline at end of file
test_doc.docx
0 → 100644
View file @
df50e760
File added
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