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
e5b7e34f
Commit
e5b7e34f
authored
Dec 09, 2018
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cookies
parent
1ffd3535
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
374 additions
and
61 deletions
+374
-61
workspace.xml
.idea/workspace.xml
+0
-0
auto_at_once.py
auto_at_once.py
+12
-4
auto_click.py
auto_click.py
+6
-2
auto_click_n.py
auto_click_n.py
+7
-2
auto_click_one.py
auto_click_one.py
+7
-4
auto_commnet.py
auto_commnet.py
+3
-1
auto_every_day.py
auto_every_day.py
+9
-4
auto_follow.py
auto_follow.py
+6
-2
auto_follow_majia.py
auto_follow_majia.py
+7
-5
auto_follow_new.py
auto_follow_new.py
+7
-2
auto_lunch_app.py
auto_lunch_app.py
+7
-5
auto_pick.py
auto_pick.py
+14
-4
auto_pick_five.py
auto_pick_five.py
+6
-2
auto_star_pick.py
auto_star_pick.py
+13
-5
auto_star_topic.py
auto_star_topic.py
+9
-3
auto_star_urge.py
auto_star_urge.py
+6
-2
auto_urge.py
auto_urge.py
+9
-4
auto_urge_three.py
auto_urge_three.py
+6
-3
dd.py
dd.py
+240
-7
No files found.
.idea/workspace.xml
View file @
e5b7e34f
This diff is collapsed.
Click to expand it.
auto_at_once.py
View file @
e5b7e34f
...
...
@@ -74,7 +74,11 @@ def login():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
cok
=
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -106,7 +110,9 @@ def logins(id):
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -243,8 +249,10 @@ if __name__ == "__main__":
cookies
=
login
()
comment
=
get_comment
()
if
cookies
is
not
None
:
comment
=
get_comment
()
reply
(
cookies
,
id
,
comment
)
reply
(
cookies
,
id
,
comment
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_click.py
View file @
e5b7e34f
...
...
@@ -76,7 +76,9 @@ def login():
logging
.
info
(
"response.text
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -161,7 +163,9 @@ if __name__ == "__main__":
cook
=
login
()
click
(
cook
,
rand_id
)
if
cook
is
not
None
:
click
(
cook
,
rand_id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
...
...
auto_click_n.py
View file @
e5b7e34f
...
...
@@ -71,7 +71,9 @@ def logins():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -158,7 +160,9 @@ if __name__ == "__main__":
cook
=
logins
()
click
(
cook
,
rand_id
)
if
cook
is
not
None
:
click
(
cook
,
rand_id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
\ No newline at end of file
auto_click_one.py
View file @
e5b7e34f
...
...
@@ -21,7 +21,6 @@ def index_first():
return
None
def
get_majia
():
try
:
...
...
@@ -73,7 +72,9 @@ def logins():
logging
.
info
(
"response.text
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -86,7 +87,7 @@ def follow(cookies_get, id):
'type'
:
1
,
'id'
:
id
}
response
=
requests
.
post
(
url
=
auto_
click
_url
,
response
=
requests
.
post
(
url
=
auto_
follow
_url
,
cookies
=
cookies_get
,
data
=
post_dict
)
...
...
@@ -139,7 +140,9 @@ if __name__ == "__main__":
cook
=
logins
()
follow
(
cook
,
id
)
if
cook
is
not
None
:
follow
(
cook
,
id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
...
...
auto_commnet.py
View file @
e5b7e34f
...
...
@@ -78,7 +78,9 @@ def logins():
cook
=
cook
[
0
]
.
split
(
'='
)[
1
]
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
auto_every_day.py
View file @
e5b7e34f
...
...
@@ -22,7 +22,6 @@ def index_first():
return
None
def
get_majia
():
try
:
...
...
@@ -74,7 +73,9 @@ def logins():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -188,7 +189,9 @@ if __name__ == "__main__":
cookies
=
logins
()
follow
(
cookies
,
id
)
if
cookies
is
not
None
:
follow
(
cookies
,
id
)
user_id
=
get_topic_data
(
numtime
)
...
...
@@ -205,7 +208,9 @@ if __name__ == "__main__":
cookies
=
logins
()
pick
(
cookies
,
id
)
if
cookies
is
not
None
:
pick
(
cookies
,
id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
...
...
auto_follow.py
View file @
e5b7e34f
...
...
@@ -71,7 +71,9 @@ def logins():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -195,7 +197,9 @@ if __name__ == "__main__":
cookies
=
logins
()
follow
(
cookies
,
id
)
if
cookies
is
not
None
:
follow
(
cookies
,
id
)
# time.sleep(random.randint(2000,2500))
...
...
auto_follow_majia.py
View file @
e5b7e34f
...
...
@@ -71,7 +71,9 @@ def logins(user_id):
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -79,7 +81,6 @@ def logins(user_id):
return
None
def
follow
(
cookies_get
,
id
):
try
:
...
...
@@ -97,7 +98,6 @@ def follow(cookies_get, id):
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
def
time_conv
():
try
:
now
=
datetime
.
datetime
.
now
()
...
...
@@ -105,6 +105,7 @@ def time_conv():
return
yes_time
except
:
return
None
def
get_follw_majia
(
numtime
):
try
:
db
=
pymysql
.
connect
(
host
=
"rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com"
,
user
=
'work'
,
passwd
=
'Gengmei123'
,
...
...
@@ -122,7 +123,6 @@ def get_follw_majia(numtime):
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
None
if
__name__
==
"__main__"
:
try
:
...
...
@@ -171,7 +171,9 @@ if __name__ == "__main__":
cookies
=
logins
(
id
)
follow
(
cookies
,
i
)
if
cookies
is
not
None
:
follow
(
cookies
,
i
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
...
...
auto_follow_new.py
View file @
e5b7e34f
...
...
@@ -71,7 +71,9 @@ def logins():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -175,9 +177,12 @@ if __name__ == "__main__":
# time.sleep(random.randint(500, 1500))
for
i
in
range
(
follow_num
):
cookies
=
logins
()
follow
(
cookies
,
id
)
if
cookies
is
not
None
:
follow
(
cookies
,
id
)
# time.sleep(random.randint(2000, 3000))
...
...
auto_lunch_app.py
View file @
e5b7e34f
...
...
@@ -75,7 +75,9 @@ def logins():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -158,13 +160,13 @@ if __name__ == "__main__":
for
i
in
range
(
urge_num
):
cookies
=
index_first
()
cook
=
logins
()
pick
(
cook
,
id
)
if
cook
is
not
None
:
pick
(
cook
,
id
)
follow
(
cook
,
id
)
follow
(
cook
,
id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
...
...
auto_pick.py
View file @
e5b7e34f
...
...
@@ -104,7 +104,11 @@ def logins(id):
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
cok
=
{
'sessionid'
:
cook
}
if
cok
is
not
None
:
return
cok
except
:
...
...
@@ -216,7 +220,9 @@ if __name__ == "__main__":
cookies
=
login
()
pick
(
cookies
,
id
)
if
cookies
is
not
None
:
pick
(
cookies
,
id
)
# time.sleep(random.randint(500, 1000))
...
...
@@ -239,7 +245,9 @@ if __name__ == "__main__":
cookies
=
login
()
pick
(
cookies
,
id
)
if
cookies
is
not
None
:
pick
(
cookies
,
id
)
# time.sleep(random.randint(500, 1000))
...
...
@@ -265,7 +273,9 @@ if __name__ == "__main__":
cookies
=
logins
(
id
)
pick
(
cookies
,
i
)
if
cookies
is
not
None
:
pick
(
cookies
,
i
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_pick_five.py
View file @
e5b7e34f
...
...
@@ -72,7 +72,9 @@ def logins():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -139,7 +141,9 @@ if __name__ == "__main__":
cook
=
logins
()
Urge
(
cook
,
id
)
if
cook
is
not
None
:
Urge
(
cook
,
id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
...
...
auto_star_pick.py
View file @
e5b7e34f
...
...
@@ -71,7 +71,9 @@ def login():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -104,7 +106,9 @@ def logins(id):
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -149,12 +153,12 @@ def get_data(numtime):
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
def
get_new_user_id
(
numtime
):
try
:
db
=
pymysql
.
connect
(
host
=
"rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com"
,
user
=
'work'
,
passwd
=
'Gengmei123'
,
db
=
"alpha"
,
port
=
3306
)
...
...
@@ -213,7 +217,9 @@ if __name__ == "__main__":
cookies
=
login
()
pick
(
cookies
,
id
)
if
cookies
is
not
None
:
pick
(
cookies
,
id
)
# time.sleep(random.randint(500, 1000))
...
...
@@ -239,7 +245,9 @@ if __name__ == "__main__":
cookies
=
logins
(
id
)
pick
(
cookies
,
i
)
if
cookies
is
not
None
:
pick
(
cookies
,
i
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
auto_star_topic.py
View file @
e5b7e34f
...
...
@@ -74,7 +74,9 @@ def logins():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -178,7 +180,9 @@ if __name__ == "__main__":
cookies
=
logins
()
click
(
cookies
,
id
)
if
cookies
is
not
None
:
click
(
cookies
,
id
)
# time.sleep(random.randint(500, 1000))
...
...
@@ -196,7 +200,9 @@ if __name__ == "__main__":
cookies
=
logins
()
follow
(
cookies
,
id
)
if
cookies
is
not
None
:
follow
(
cookies
,
id
)
# time.sleep(random.randint(500, 1000))
...
...
auto_star_urge.py
View file @
e5b7e34f
...
...
@@ -71,7 +71,9 @@ def logins():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -145,7 +147,9 @@ if __name__ == "__main__":
cookies
=
logins
()
Urge
(
cookies
,
id
)
if
cookies
is
not
None
:
Urge
(
cookies
,
id
)
# time.sleep(random.randint(500, 1000))
...
...
auto_urge.py
View file @
e5b7e34f
...
...
@@ -71,7 +71,9 @@ def logins():
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
...
...
@@ -138,7 +140,6 @@ def get_star_useid(numtime):
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
None
if
__name__
==
"__main__"
:
try
:
...
...
@@ -162,7 +163,9 @@ if __name__ == "__main__":
cookies
=
logins
()
Urge
(
cookies
,
id
)
if
cookies
is
not
None
:
Urge
(
cookies
,
id
)
# time.sleep(random.randint(500, 1000))
...
...
@@ -183,7 +186,9 @@ if __name__ == "__main__":
cookies
=
logins
()
Urge
(
cookies
,
id
)
if
cookies
is
not
None
:
Urge
(
cookies
,
id
)
# time.sleep(random.randint(500, 1000))
...
...
auto_urge_three.py
View file @
e5b7e34f
...
...
@@ -62,7 +62,9 @@ def logins():
cook
=
headers
[
'Set-Cookie'
]
.
split
(
";"
)
cook
=
cook
[
0
]
.
split
(
'='
)[
1
]
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
return
{
'sessionid'
:
cook
}
if
cook
is
not
None
:
return
{
'sessionid'
:
cook
}
except
:
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
return
None
...
...
@@ -125,11 +127,12 @@ if __name__ == "__main__":
urge_num
=
random
.
randint
(
1
,
2
)
for
i
in
range
(
urge_num
):
cookies
=
index_first
()
cook
=
logins
()
pick
(
cook
,
id
)
if
cook
is
not
None
:
pick
(
cook
,
id
)
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
...
...
dd.py
View file @
e5b7e34f
import
requests
import
time
import
datetime
import
pymysql
import
random
import
traceback
# from log_settings import *
import
logging
auto_pick_url
=
"http://172.30.8.42:9001/api/v1/pick/do_pick"
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
(
','
))
# time.sleep(random.randint(0, 500))
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
login
():
try
:
# time.sleep(random.randint(300, 500))
user_id
=
get_majia
()
cookies
=
index_first
()
post_dict
=
{
'account_type'
:
2
,
'pwd'
:
'123456'
,
'email'
:
user_id
}
response
=
requests
.
post
(
url
=
login_url
,
data
=
post_dict
,
cookies
=
cookies
)
headers
=
response
.
headers
cook
=
headers
[
'Set-Cookie'
]
.
split
(
";"
)
cook
=
cook
[
0
]
.
split
(
'='
)[
1
]
if
cook
is
not
None
:
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
print
({
'sessionid'
:
cook
})
return
{
'sessionid'
:
cook
}
except
:
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
return
None
def
logins
(
id
):
try
:
cookies
=
index_first
()
post_dict
=
{
'account_type'
:
2
,
'pwd'
:
'123456'
,
'email'
:
id
}
response
=
requests
.
post
(
url
=
login_url
,
data
=
post_dict
,
cookies
=
cookies
)
headers
=
response
.
headers
cook
=
headers
[
'Set-Cookie'
]
.
split
(
";"
)
cook
=
cook
[
0
]
.
split
(
'='
)[
1
]
logging
.
info
(
"response.text :
%
s"
%
response
.
text
)
cok
=
{
'sessionid'
:
cook
}
print
(
cok
)
if
cok
is
not
None
:
return
cok
except
:
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
return
None
def
pick
(
cookies_get
,
id
):
try
:
post_dict
=
{
'pick_user_id'
:
id
,
'is_pick'
:
1
,
'pick_type'
:
0
}
response
=
requests
.
post
(
url
=
auto_pick_url
,
cookies
=
cookies_get
,
data
=
post_dict
)
print
(
response
.
text
)
logging
.
info
(
"response.text:
%
s"
%
response
.
text
)
except
:
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
print
(
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 distinct(id) FROM picktopic WHERE 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
def
get_new_user_id
(
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 from account_user WHERE is_online =1 and create_time LIKE '
%%%%%
s
%%%%
'"
%
numtime
)
data_new_user
=
cursor
.
fetchall
()
data
=
list
(
data_new_user
)
logging
.
info
(
"Database version :
%
s "
%
data
)
db
.
close
()
return
user_id
except
:
logging
.
error
(
"catch exception,get_data:
%
s"
%
traceback
.
format_exc
())
return
None
def
get_star_useid
(
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 FROM topic WHERE content_level =4 or content_level =5 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
]
#topic
for
i
in
range
(
len
(
time_list
)):
numtime
=
time_conv
(
time_list
[
i
])
# user_id = get_data(numtime)
user_id
=
[
1
,
2
,
3
]
for
j
in
user_id
:
# time.sleep(random.randint(200,500))
pick_num
=
random
.
randint
(
1
,
2
)
for
i
in
range
(
pick_num
):
cookies
=
login
()
if
cookies
is
not
None
:
pick
(
cookies
,
j
)
# time.sleep(random.randint(500, 1000))
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
for
i
in
range
(
3
):
print
(
i
)
for
i
in
range
(
3
):
print
(
i
)
for
i
in
range
(
3
):
print
(
i
)
\ 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