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
cf9377da
Commit
cf9377da
authored
Apr 23, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
752d1826
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1 addition
and
205 deletions
+1
-205
workspace.xml
.idea/workspace.xml
+0
-0
auto_at_once.py
auto_at_once.py
+0
-86
auto_click_n.py
auto_click_n.py
+0
-2
auto_commnet.py
auto_commnet.py
+1
-4
auto_star_urge.py
auto_star_urge.py
+0
-1
auto_urge.py
auto_urge.py
+0
-1
com.py
com.py
+0
-14
instant.py
instant.py
+0
-97
No files found.
.idea/workspace.xml
View file @
cf9377da
This diff is collapsed.
Click to expand it.
auto_at_once.py
deleted
100644 → 0
View file @
752d1826
import
requests
import
time
import
datetime
import
pymysql
import
random
import
pandas
as
pd
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
reply
,
click
,
get_comments
,
time_conv
,
get_user_id
from
auto_request
import
host
,
user
,
port
,
db
,
passwd
def
get_topic_id
(
numtime
):
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
port
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT user_id ,id FROM topic WHERE is_online =1 and create_time >=
%
s"
,(
numtime
))
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
user_list
=
get_user_id
()
topic_id_list
=
[]
if
topic_id
:
for
i
in
topic_id
:
if
int
(
i
[
1
])
not
in
user_list
:
topic_id_list
.
append
(
i
)
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
None
if
__name__
==
"__main__"
:
try
:
numtime
=
time_conv
(
15
)
topic_id
=
get_topic_id
(
numtime
)
click_num
=
random
.
randint
(
1
,
5
)
for
i
in
range
(
click_num
):
for
j
in
topic_id
:
id
=
int
(
j
[
0
])
cookies
=
login
()
time
.
sleep
(
random
.
randint
(
10
,
20
))
click
(
cookies
,
id
)
time
.
sleep
(
300
)
topic_id
=
get_topic_id
(
numtime
)
comment_num
=
random
.
randint
(
0
,
3
)
comment_content
=
get_comments
()
for
i
in
range
(
comment_num
):
for
j
in
topic_id
:
id
=
int
(
j
[
0
])
cookies
=
login
()
if
cookies
is
not
None
:
comment
=
comment_content
[
i
]
time
.
sleep
(
random
.
randint
(
10
,
20
))
reply
(
cookies
,
id
,
comment
)
time
.
sleep
(
300
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
# 发帖瞬时:[1 - 5]个马甲点赞
# 1. 用户发帖后,[瞬时],1-3条评论
auto_click_n.py
View file @
cf9377da
...
...
@@ -79,5 +79,3 @@ if __name__ == "__main__":
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
# 7天后,每日一次轮询,3*n日前新增帖子:[0-1]个马甲点赞。每天每人最多一个帖子点赞。
auto_commnet.py
View file @
cf9377da
...
...
@@ -48,10 +48,7 @@ if __name__ == "__main__":
numtime
=
time_convs
(
i
)
# topic_id = get_topic_id(numtime)
topic_id
=
[(
241581376
,
5479267
),
(
241439646
,
5479268
),
(
241439646
,
5479269
),
(
241407671
,
5479270
),
(
241407671
,
5479271
),
(
241581395
,
5479272
)]
topic_id
=
get_topic_id
(
numtime
)
dicts
=
{}
...
...
auto_star_urge.py
View file @
cf9377da
...
...
@@ -3,7 +3,6 @@ import time
import
datetime
import
pymysql
import
random
import
pandas
as
pd
import
traceback
from
log_settings
import
*
import
logging
...
...
auto_urge.py
View file @
cf9377da
...
...
@@ -3,7 +3,6 @@ import time
import
datetime
import
pymysql
import
random
import
pandas
as
pd
import
traceback
from
log_settings
import
*
import
logging
...
...
com.py
deleted
100644 → 0
View file @
752d1826
import
requests
import
time
import
datetime
import
pymysql
import
random
import
traceback
import
logging
from
log_settings
import
*
from
auto_request
import
login
,
time_convs
,
reply
,
get_comment
from
auto_request
import
host
,
user
,
db
,
passwd
cookies
=
login
()
reply
(
cookies
,
id
=
1
,
content
=
'来啦来啦来啦来啦来啦'
)
instant.py
deleted
100644 → 0
View file @
752d1826
import
requests
import
time
import
datetime
import
pymysql
import
random
import
pandas
as
pd
import
traceback
from
log_settings
import
*
import
logging
from
auto_request
import
login
,
click
,
get_comments
,
reply
import
threading
from
auto_request
import
host
,
user
,
db
,
passwd
if
__name__
==
"__main__"
:
try
:
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT id,user_id FROM topic WHERE id = "
+
str
(
45456
)
+
" and user_id in (select user_id from user_extra where is_shadow = 0)"
)
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
topic_id_list
=
[
87
]
exec_count
=
0
if
topic_id_list
:
def
fun_comment
():
cookies
=
login
()
if
cookies
:
comment_content
=
get_comments
()
logging
.
info
(
"get comment:
%
s"
%
comment_content
)
num
=
random
.
randint
(
0
,
2
)
comment
=
comment_content
[
num
]
logging
.
info
(
"get comment:
%
s"
%
comment
)
reply
(
cookies
,
topic_id_list
[
0
],
comment
)
global
timer
global
exec_count
exec_count
+=
1
if
exec_count
==
1
:
print
(
"----1------"
)
sleep_time
=
random
.
randint
(
300
,
540
)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_comment
)
timer
.
start
()
if
exec_count
==
2
:
print
(
"----2------"
)
sleep_time
=
random
.
randint
(
1000
,
1900
)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_comment
)
timer
.
start
()
# def fun_timer():
# cookies = login()
# if cookies:
# click(cookies, topic_id_list[0])
#
# global timer
# global exec_count
#
# exec_count += 1
# if exec_count == 1:
# print("----3------")
#
# # sleep_time = random.randint(300, 540)
# sleep_time = 30
# timer = threading.Timer(sleep_time, fun_timer)
# timer.start()
#
# if exec_count == 2:
# print("----4------")
#
# # sleep_time = random.randint(1000, 1900)
# sleep_time = 50
# timer = threading.Timer(sleep_time, fun_timer)
# timer.start()
sleep_time
=
random
.
randint
(
300
,
540
)
timer
=
threading
.
Timer
(
10
,
fun_comment
)
# 首次启动
timer
.
start
()
# sleep_time = random.randint(300, 540)
# timer = threading.Timer(10, fun_timer) # 首次启动
# timer.start()
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