Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cybertron
Project
Project
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
alpha
cybertron
Commits
8efe5979
Commit
8efe5979
authored
Apr 23, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
01c5508f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
27 deletions
+47
-27
workspace.xml
.idea/workspace.xml
+0
-0
auto_click.py
auto_click.py
+10
-9
auto_click_n.py
auto_click_n.py
+7
-7
auto_follow_majia.py
auto_follow_majia.py
+2
-6
auto_follow_one.py
auto_follow_one.py
+2
-3
auto_request.py
auto_request.py
+9
-2
testss.py
testss.py
+17
-0
No files found.
.idea/workspace.xml
View file @
8efe5979
This diff is collapsed.
Click to expand it.
auto_click.py
View file @
8efe5979
...
...
@@ -8,17 +8,17 @@ from auto_request import login, click, time_convs
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_data
(
numtime
):
def
get_data
(
numtime
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and create_time LIKE '
%%%%%
s
%%%%
'"
%
numtime
)
"SELECT user_id,id FROM topic WHERE is_online=1 and create_time > '
%
s' and create_time < '
%
s'"
%
(
numtime
,
numtime2
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
if
topic_id
:
for
i
in
topic_id
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
...
...
@@ -28,6 +28,7 @@ def get_data(numtime):
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
return
topic_id_list
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
[]
...
...
@@ -41,15 +42,15 @@ if __name__ == "__main__":
for
i
in
time_list
:
numtime
=
time_convs
(
i
)
numtime
,
numtime2
=
time_convs
(
i
+
1
,
i
-
1
)
logging
.
info
(
"get numtime :
%
s "
%
numtime
)
logging
.
info
(
"get numtime2 :
%
s"
%
numtime2
)
user_id
=
get_data
(
numtime
)
user_id
=
get_data
(
numtime
,
numtime2
)
dicts
=
{}
if
user_id
:
for
i
in
user_id
:
for
i
in
user_id
and
user_id
:
if
i
[
0
]
not
in
dicts
.
keys
():
dicts
.
setdefault
(
i
[
0
],
[])
...
...
auto_click_n.py
View file @
8efe5979
...
...
@@ -9,18 +9,17 @@ from auto_request import login, click, time_convs
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_data
(
numtime
):
def
get_data
(
numtime
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id , id FROM topic WHERE is_online=1 and create_time
LIKE '
%%%%%
s
%%%%
' "
%
numtime
)
"SELECT user_id , id FROM topic WHERE is_online=1 and create_time
> '
%%%%%
s
%%%%
' and create_time < '
%%%%%
s
%%%%
' "
%
(
numtime
,
numtime2
)
)
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id_list
=
[]
if
topic_id
:
for
i
in
topic_id
:
for
i
in
topic_id
and
topic_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0"
)
data
=
cursor
.
fetchall
()
...
...
@@ -50,9 +49,7 @@ if __name__ == "__main__":
dict
=
{}
if
user_id
:
for
i
in
user_id
:
for
i
in
user_id
and
user_id
:
if
i
[
0
]
not
in
dict
.
keys
():
...
...
@@ -80,5 +77,8 @@ if __name__ == "__main__":
if
cook
is
not
None
:
click
(
cook
,
rand_id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_follow_majia.py
View file @
8efe5979
...
...
@@ -39,9 +39,7 @@ if __name__ == "__main__":
dict_follow_id
=
{}
if
data
:
for
j
in
data
:
for
j
in
data
and
data
:
if
j
[
2
]
!=
None
:
...
...
@@ -56,9 +54,7 @@ if __name__ == "__main__":
dict_email
=
{}
if
data
:
for
j
in
data
:
for
j
in
data
and
data
:
if
j
[
2
]
!=
None
:
...
...
auto_follow_one.py
View file @
8efe5979
...
...
@@ -19,9 +19,8 @@ def get_data(numtime):
(
numtime
))
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
topic_id_list
=
[]
for
i
in
user_id
:
for
i
in
user_id
and
user_id
:
cursor
.
execute
(
"select user_id from user_extra where user_id ="
+
str
(
i
[
0
])
+
" and is_shadow =0 "
)
data
=
cursor
.
fetchall
()
...
...
@@ -47,7 +46,7 @@ if __name__ == "__main__":
for
j
in
range
(
urge_num
):
for
i
in
user_id
:
for
i
in
user_id
and
user_id
:
cookies
=
get_cookies
(
i
)
...
...
auto_request.py
View file @
8efe5979
...
...
@@ -137,12 +137,19 @@ def time_conv(minutest):
return
None
def
time_convs
(
numtime
):
def
time_convs
(
numtime
,
numtime2
):
try
:
now
=
datetime
.
datetime
.
now
()
yes_time
=
now
-
datetime
.
timedelta
(
days
=
numtime
)
yes_time_str
=
yes_time
.
strftime
(
'
%
Y-
%
m-
%
d'
)
return
yes_time_str
yes_time_str
=
yes_time_str
+
' 23:59:59.000000'
yes_time2
=
now
-
datetime
.
timedelta
(
days
=
numtime2
)
yes_time_str2
=
yes_time2
.
strftime
(
'
%
Y-
%
m-
%
d'
)
yes_time_str2
=
yes_time_str2
+
' 00:00:00.000000'
return
yes_time_str
,
yes_time_str2
except
:
return
None
...
...
testss.py
0 → 100644
View file @
8efe5979
import
datetime
now
=
datetime
.
datetime
.
now
()
yes_time
=
now
-
datetime
.
timedelta
(
days
=
2
)
yes_time_str
=
yes_time
.
strftime
(
'
%
Y-
%
m-
%
d'
)
yes_time_str
=
yes_time_str
+
' 23:59:59.000000'
yes_time2
=
now
-
datetime
.
timedelta
(
days
=
0
)
yes_time_str2
=
yes_time2
.
strftime
(
'
%
Y-
%
m-
%
d'
)
yes_time_str2
=
yes_time_str2
+
' 00:00:00.000000'
print
(
yes_time_str
)
print
(
yes_time_str2
)
\ 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