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
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
41 additions
and
24 deletions
+41
-24
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
+4
-0
auto_follow_one.py
auto_follow_one.py
+4
-1
auto_star_topic.py
auto_star_topic.py
+8
-5
auto_star_urge.py
auto_star_urge.py
+10
-4
auto_urge.py
auto_urge.py
+6
-3
auto_urge_three.py
auto_urge_three.py
+4
-6
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,6 +105,8 @@ if __name__ == "__main__":
user_id
=
get_commnet_id
(
numtime1
)
try
:
for
j
in
user_id
and
user_id
:
id
=
int
(
j
[
0
])
...
...
@@ -119,6 +121,8 @@ if __name__ == "__main__":
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,6 +46,8 @@ if __name__ == "__main__":
for
j
in
range
(
urge_num
):
try
:
for
i
in
user_id
and
user_id
:
cookies
=
get_cookies
(
i
)
...
...
@@ -56,6 +58,7 @@ if __name__ == "__main__":
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,9 +43,11 @@ 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
)
try
:
for
j
in
user_id
and
user_id
:
...
...
@@ -59,5 +62,8 @@ if __name__ == "__main__":
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,11 +48,12 @@ 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
:
...
...
@@ -64,5 +65,7 @@ if __name__ == "__main__":
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,6 +50,8 @@ if __name__ == "__main__":
for
j
in
range
(
2
):
try
:
for
i
in
user_id
and
user_id
:
time
.
sleep
(
random
.
randint
(
10
,
15
))
...
...
@@ -58,12 +60,8 @@ if __name__ == "__main__":
if
cook
is
not
None
:
Urge
(
cook
,
i
)
sleep_time
=
random
.
randint
(
300
,
540
)
timer
=
threading
.
Timer
(
1
,
urge_user
)
# 首次启动
timer
.
start
()
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