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
1625fbf1
Commit
1625fbf1
authored
Apr 23, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
ba05f067
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
54 deletions
+71
-54
workspace.xml
.idea/workspace.xml
+0
-0
auto_every_day.py
auto_every_day.py
+1
-1
auto_follow.py
auto_follow.py
+4
-4
auto_follow_new.py
auto_follow_new.py
+12
-8
auto_follow_one.py
auto_follow_one.py
+9
-6
auto_star_topic.py
auto_star_topic.py
+8
-5
auto_star_urge.py
auto_star_urge.py
+17
-11
auto_urge.py
auto_urge.py
+12
-9
auto_urge_three.py
auto_urge_three.py
+8
-10
No files found.
.idea/workspace.xml
View file @
1625fbf1
This diff is collapsed.
Click to expand it.
auto_every_day.py
View file @
1625fbf1
...
...
@@ -56,7 +56,7 @@ if __name__ == "__main__":
numtime1
,
numtime2
=
time_convs
(
1
,
1
)
user_id
=
get_topic_new_user
(
numtime1
,
numtime2
)
user_id
=
get_topic_new_user
(
numtime1
,
numtime2
)
follow_num
=
random
.
randint
(
1
,
2
)
...
...
auto_follow.py
View file @
1625fbf1
...
...
@@ -54,9 +54,9 @@ if __name__ == "__main__":
for
i
in
range
(
follow_num
):
if
user_id
:
try
:
for
j
in
user_id
:
for
j
in
user_id
and
user_id
:
id
=
int
(
j
[
0
])
...
...
@@ -67,8 +67,8 @@ if __name__ == "__main__":
if
cookies
is
not
None
:
follow
(
cookies
,
id
)
time
.
sleep
(
60
)
except
:
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_follow_new.py
View file @
1625fbf1
...
...
@@ -105,20 +105,24 @@ if __name__ == "__main__":
user_id
=
get_commnet_id
(
numtime1
)
for
j
in
user_id
and
user_id
:
try
:
id
=
int
(
j
[
0
])
for
j
in
user_id
and
user_id
:
follow_num
=
random
.
randint
(
0
,
1
)
id
=
int
(
j
[
0
]
)
for
i
in
range
(
follow_num
):
follow_num
=
random
.
randint
(
0
,
1
)
time
.
sleep
(
random
.
randint
(
10
,
50
))
for
i
in
range
(
follow_num
):
cookies
=
login
(
)
time
.
sleep
(
random
.
randint
(
10
,
50
)
)
if
cookies
is
not
None
:
follow
(
cookies
,
id
)
cookies
=
login
()
if
cookies
is
not
None
:
follow
(
cookies
,
id
)
except
:
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_follow_one.py
View file @
1625fbf1
...
...
@@ -46,16 +46,19 @@ if __name__ == "__main__":
for
j
in
range
(
urge_num
):
for
i
in
user_id
and
user_id
:
try
:
cookies
=
get_cookies
(
i
)
for
i
in
user_id
and
user_id
:
time
.
sleep
(
random
.
randint
(
10
,
40
)
)
cookies
=
get_cookies
(
i
)
cook
=
login
(
)
time
.
sleep
(
random
.
randint
(
10
,
40
)
)
if
cook
is
not
None
:
follow
(
cook
,
i
)
cook
=
login
()
if
cook
is
not
None
:
follow
(
cook
,
i
)
except
:
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_star_topic.py
View file @
1625fbf1
...
...
@@ -10,12 +10,13 @@ from auto_request import login, time_convs, follow, click
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_star_user_id
(
numtime
):
def
get_star_user_id
(
numtime
1
,
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 (content_level =4 or content_level =5) and create_time > '
%
s' "
%
numtime
)
"SELECT user_id,id FROM topic WHERE is_online=1 and (content_level =4 or content_level =5) and create_time > '
%
s' and create_time < '
%
s' "
%
(
numtime1
,
numtime2
))
data
=
cursor
.
fetchall
()
user_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
user_id_list
)
...
...
@@ -45,11 +46,11 @@ if __name__ == "__main__":
numtime1
,
numtime2
=
time_convs
(
i
+
1
,
i
-
1
)
user_topic_id
=
get_star_user_id
(
numtime1
)
user_topic_id
=
get_star_user_id
(
numtime1
,
numtime2
)
if
user_topic_id
:
try
:
for
j
in
user_topic_id
:
for
j
in
user_topic_id
and
user_topic_id
:
id
=
int
(
j
[
1
])
...
...
@@ -63,6 +64,8 @@ if __name__ == "__main__":
if
cookies
is
not
None
:
click
(
cookies
,
id
)
except
:
pass
user_id
=
get_star_user_id
(
numtime1
)
...
...
auto_star_urge.py
View file @
1625fbf1
...
...
@@ -10,12 +10,13 @@ from auto_request import login, time_convs, Urge
from
auto_request
import
host
,
user
,
db
,
passwd
def
get_star_useid
(
numtime
):
def
get_star_useid
(
numtime
1
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and (content_level =4 or content_level =5) and create_time > '
%
s'"
%
numtime
)
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and (content_level =4 or content_level =5) and create_time > '
%
s' and create_time < '
%
s'"
%
(
numtime1
,
numtime2
))
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
topic_id_list
=
[]
...
...
@@ -42,22 +43,27 @@ if __name__ == "__main__":
for
i
in
time_list
:
numtime1
,
numtime2
=
time_convs
(
i
+
1
,
i
-
1
)
numtime1
,
numtime2
=
time_convs
(
i
+
1
,
i
-
1
)
user_id
=
get_star_useid
(
numtime1
)
user_id
=
get_star_useid
(
numtime1
,
numtime2
)
for
j
in
user_id
and
user_id
:
try
:
id
=
int
(
j
[
0
])
for
j
in
user_id
and
user_id
:
for
i
in
range
(
1
):
id
=
int
(
j
[
0
])
time
.
sleep
(
random
.
randint
(
10
,
50
))
for
i
in
range
(
1
):
cookies
=
login
(
)
time
.
sleep
(
random
.
randint
(
10
,
50
)
)
if
cookies
is
not
None
:
Urge
(
cookies
,
id
)
cookies
=
login
()
if
cookies
is
not
None
:
Urge
(
cookies
,
id
)
except
:
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_urge.py
View file @
1625fbf1
...
...
@@ -11,12 +11,12 @@ from auto_request import host, user, db, passwd
import
threading
def
get_data
(
numtime
):
def
get_data
(
numtime
1
,
numtime2
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time > '
%
s'
"
%
numtime
)
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time > '
%
s'
and create_time < '
%
s'"
%
(
numtime1
,
numtime2
)
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
...
...
@@ -48,21 +48,24 @@ if __name__ == "__main__":
numtime1
,
numtime2
=
time_convs
(
i
+
1
,
i
-
1
)
user_id
=
get_data
(
numtime1
)
user_id
=
get_data
(
numtime1
,
numtime2
)
urge_num
=
random
.
randint
(
0
,
2
)
for
i
in
range
(
urge_num
):
try
:
for
j
in
user_id
and
user_id
:
for
j
in
user_id
and
user_id
:
id
=
int
(
j
[
0
])
id
=
int
(
j
[
0
])
time
.
sleep
(
random
.
randint
(
10
,
50
))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cookies
=
login
()
cookies
=
login
()
if
cookies
is
not
None
:
Urge
(
cookies
,
id
)
if
cookies
is
not
None
:
Urge
(
cookies
,
id
)
except
:
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_urge_three.py
View file @
1625fbf1
...
...
@@ -50,20 +50,18 @@ if __name__ == "__main__":
for
j
in
range
(
2
):
for
i
in
user_id
and
user_id
:
try
:
time
.
sleep
(
random
.
randint
(
10
,
15
))
for
i
in
user_id
and
user_id
:
cook
=
login
(
)
time
.
sleep
(
random
.
randint
(
10
,
15
)
)
if
cook
is
not
None
:
Urge
(
cook
,
i
)
sleep_time
=
random
.
randint
(
300
,
540
)
timer
=
threading
.
Timer
(
1
,
urge_user
)
# 首次启动
timer
.
start
()
cook
=
login
()
if
cook
is
not
None
:
Urge
(
cook
,
i
)
except
:
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
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