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
691d1d3e
Commit
691d1d3e
authored
Dec 12, 2018
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add sleep_time
parent
a67a9c25
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
11 additions
and
182 deletions
+11
-182
workspace.xml
.idea/workspace.xml
+0
-0
auto_click_n.py
auto_click_n.py
+3
-1
auto_click_ssss.py
auto_click_ssss.py
+0
-171
auto_commnet.py
auto_commnet.py
+1
-1
auto_follow.py
auto_follow.py
+1
-1
auto_follow_majia.py
auto_follow_majia.py
+0
-2
auto_follow_new.py
auto_follow_new.py
+1
-1
auto_follow_one.py
auto_follow_one.py
+1
-1
auto_lunch_app.py
auto_lunch_app.py
+1
-1
auto_star_topic.py
auto_star_topic.py
+1
-1
auto_star_urge.py
auto_star_urge.py
+1
-1
auto_urge.py
auto_urge.py
+1
-1
No files found.
.idea/workspace.xml
View file @
691d1d3e
This diff is collapsed.
Click to expand it.
auto_click_n.py
View file @
691d1d3e
...
...
@@ -138,7 +138,9 @@ if __name__ == "__main__":
for
i
in
user_id
:
if
i
[
0
]
not
in
dict
.
keys
():
dict
.
setdefault
(
i
[
0
],
[])
dict
[
i
[
0
]]
.
append
(
i
[
1
])
else
:
...
...
@@ -154,7 +156,7 @@ if __name__ == "__main__":
for
i
in
range
(
urge_num
):
#
time.sleep(random.randint(10, 50))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
logins
()
...
...
auto_click_ssss.py
deleted
100644 → 0
View file @
a67a9c25
import
requests
import
time
import
datetime
import
pymysql
import
random
import
traceback
from
log_settings
import
*
import
logging
auto_click_url
=
"http://earth.igengmei.com/api/v1/like"
login_url
=
"http://earth.igengmei.com/api/account/login_pwd"
def
index_first
():
try
:
r1
=
requests
.
get
(
login_url
)
return
r1
.
cookies
.
get_dict
()
except
:
logging
.
error
(
"index_first:
%
s"
%
traceback
.
format_exc
())
return
None
def
get_majia
():
try
:
data
=
open
(
"batch_user_gen"
)
list
=
[]
for
i
in
data
:
list
.
append
(
i
.
strip
(
'
\n
'
)
.
strip
(
','
))
maj
=
random
.
randint
(
1
,
len
(
list
))
user_id
=
list
[
maj
-
1
]
return
user_id
except
:
logging
.
error
(
"catch exception,get_majia:
%
s"
%
traceback
.
format_exc
())
return
None
def
get_cookies
(
user_id
):
try
:
with
open
(
"user_session.txt"
,
'r'
)
as
f
:
try
:
data
=
f
.
readlines
()
except
:
data
=
None
list
=
[]
for
i
in
data
:
list
.
append
(
i
.
strip
(
'
\n
'
)
.
split
(
","
))
for
i
in
list
:
if
user_id
==
i
[
0
]:
return
(
i
[
1
])
except
:
return
None
def
login
():
try
:
user_id
=
get_majia
()
cookies
=
get_cookies
(
user_id
)
if
cookies
is
not
None
:
return
{
'sessionid'
:
cookies
}
except
:
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
return
None
def
click
(
cookies_get
,
id
):
try
:
post_dict
=
{
'type'
:
0
,
'id'
:
id
}
response
=
requests
.
post
(
url
=
auto_click_url
,
cookies
=
cookies_get
,
data
=
post_dict
)
logging
.
info
(
"response.text:
%
s"
%
response
.
text
)
except
:
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
def
time_conv
(
numtime
):
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
except
:
return
None
def
get_data
(
numtime
):
try
:
db
=
pymysql
.
connect
(
host
=
"rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com"
,
user
=
'work'
,
passwd
=
'Gengmei123'
,
db
=
"alpha"
,
port
=
3306
)
cursor
=
db
.
cursor
()
cursor
.
execute
(
"SELECT user_id,id FROM topic WHERE is_online=1 and create_time LIKE '
%%%%%
s
%%%%
'"
%
numtime
)
data
=
cursor
.
fetchall
()
user_id
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
user_id
)
db
.
close
()
return
user_id
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
None
if
__name__
==
"__main__"
:
try
:
time_list
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
]
for
i
in
time_list
:
numtime
=
time_conv
(
i
)
user_id
=
get_data
(
numtime
)
dict
=
{}
for
i
in
user_id
:
if
i
[
0
]
not
in
dict
.
keys
():
dict
.
setdefault
(
i
[
0
],
[])
dict
[
i
[
0
]]
.
append
(
i
[
1
])
else
:
dict
[
i
[
0
]]
.
append
(
i
[
1
])
for
key
,
value
in
dict
.
items
():
rand_num
=
random
.
randint
(
0
,
len
(
value
)
-
1
)
rand_id
=
value
[
rand_num
]
urge_num
=
random
.
randint
(
0
,
1
)
for
i
in
range
(
urge_num
):
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
login
()
if
cook
is
not
None
:
click
(
cook
,
rand_id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_commnet.py
View file @
691d1d3e
...
...
@@ -148,7 +148,7 @@ if __name__ == "__main__":
for
i
in
topic_id
:
#
time.sleep(random.randint(10, 50))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
logins
()
...
...
auto_follow.py
View file @
691d1d3e
...
...
@@ -142,7 +142,7 @@ if __name__ == "__main__":
for
i
in
range
(
follow_num
):
#
time.sleep(random.randint(10, 50))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cookies
=
logins
()
...
...
auto_follow_majia.py
View file @
691d1d3e
...
...
@@ -147,8 +147,6 @@ if __name__ == "__main__":
for
i
in
value
:
# time.sleep(random.randint(10, 50))
cookies
=
logins
(
id
)
if
cookies
is
not
None
:
...
...
auto_follow_new.py
View file @
691d1d3e
...
...
@@ -188,7 +188,7 @@ if __name__ == "__main__":
for
i
in
range
(
follow_num
):
#
time.sleep(random.randint(10, 50))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cookies
=
logins
()
...
...
auto_follow_one.py
View file @
691d1d3e
...
...
@@ -134,7 +134,7 @@ if __name__ == "__main__":
cookies
=
index_first
()
#
time.sleep(random.randint(10, 50))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
logins
()
...
...
auto_lunch_app.py
View file @
691d1d3e
...
...
@@ -133,7 +133,7 @@ if __name__ == "__main__":
for
i
in
range
(
urge_num
):
#
time.sleep(random.randint(10, 50))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cook
=
logins
()
...
...
auto_star_topic.py
View file @
691d1d3e
...
...
@@ -198,7 +198,7 @@ if __name__ == "__main__":
for
i
in
range
(
urge_num
):
#
time.sleep(random.randint(10, 50))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cookies
=
logins
()
...
...
auto_star_urge.py
View file @
691d1d3e
...
...
@@ -143,7 +143,7 @@ if __name__ == "__main__":
for
i
in
range
(
1
):
#
time.sleep(random.randint(10, 50))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cookies
=
logins
()
...
...
auto_urge.py
View file @
691d1d3e
...
...
@@ -179,7 +179,7 @@ if __name__ == "__main__":
for
i
in
range
(
1
):
#
time.sleep(random.randint(10, 50))
time
.
sleep
(
random
.
randint
(
10
,
50
))
cookies
=
logins
()
...
...
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