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
02f87232
Commit
02f87232
authored
Dec 08, 2018
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
majia new
parent
dae37642
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
32 deletions
+29
-32
workspace.xml
.idea/workspace.xml
+12
-19
auto_commnet.py
auto_commnet.py
+17
-13
No files found.
.idea/workspace.xml
View file @
02f87232
...
@@ -2,14 +2,7 @@
...
@@ -2,14 +2,7 @@
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"fd1f0b61-1139-44e5-87e7-f8b86ff52376"
name=
"Default Changelist"
comment=
""
>
<list
default=
"true"
id=
"fd1f0b61-1139-44e5-87e7-f8b86ff52376"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/auto_at_once.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/auto_at_once.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/auto_click.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/auto_click.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/auto_click_n.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/auto_click_n.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/auto_commnet.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/auto_commnet.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/auto_commnet.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/auto_commnet.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/auto_every.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/auto_every_day.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/auto_follow_majia.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/auto_follow_majia.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/exercise.py"
beforeDir=
"false"
/>
</list>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
...
@@ -92,7 +85,7 @@
...
@@ -92,7 +85,7 @@
<entry
key=
"cuigeng"
value=
"1"
/>
<entry
key=
"cuigeng"
value=
"1"
/>
<entry
key=
"data"
value=
"12"
/>
<entry
key=
"data"
value=
"12"
/>
<entry
key=
"dummy"
value=
"15"
/>
<entry
key=
"dummy"
value=
"15"
/>
<entry
key=
"py"
value=
"6
424
"
/>
<entry
key=
"py"
value=
"6
521
"
/>
<entry
key=
"unr_data"
value=
"1"
/>
<entry
key=
"unr_data"
value=
"1"
/>
<entry
key=
"xuqiu"
value=
"1"
/>
<entry
key=
"xuqiu"
value=
"1"
/>
</counts>
</counts>
...
@@ -100,7 +93,7 @@
...
@@ -100,7 +93,7 @@
<usages-collector
id=
"statistics.file.types.edit"
>
<usages-collector
id=
"statistics.file.types.edit"
>
<counts>
<counts>
<entry
key=
"PLAIN_TEXT"
value=
"161"
/>
<entry
key=
"PLAIN_TEXT"
value=
"161"
/>
<entry
key=
"Python"
value=
"6
424
"
/>
<entry
key=
"Python"
value=
"6
521
"
/>
</counts>
</counts>
</usages-collector>
</usages-collector>
</session>
</session>
...
@@ -185,16 +178,16 @@
...
@@ -185,16 +178,16 @@
<file
pinned=
"false"
current-in-tab=
"true"
>
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/auto_commnet.py"
>
<entry
file=
"file://$PROJECT_DIR$/auto_commnet.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"30
0
"
>
<state
relative-caret-position=
"30
4
"
>
<caret
line=
"
83"
lean-forward=
"true"
selection-start-line=
"83"
selection-end-line=
"83
"
/>
<caret
line=
"
143"
column=
"26"
selection-start-line=
"143"
selection-start-column=
"26"
selection-end-line=
"143"
selection-end-column=
"26
"
/>
<folding>
<folding>
<element
signature=
"e#0#15#0"
expanded=
"true"
/>
<element
signature=
"e#0#15#0"
expanded=
"true"
/>
<element
signature=
"e#279#467#0"
/>
<element
signature=
"e#279#467#0"
/>
<element
signature=
"e#522#891#0"
/>
<element
signature=
"e#522#891#0"
/>
<element
signature=
"e#
763#1552
#0"
/>
<element
signature=
"e#
934#1723
#0"
/>
<element
signature=
"e#1821#2191#0"
/>
<element
signature=
"e#1821#2191#0"
/>
<element
signature=
"e#2284#2495#0"
/>
<element
signature=
"e#2284#2495#0"
/>
<element
signature=
"e#2472#29
79
#0"
/>
<element
signature=
"e#2472#29
55
#0"
/>
<element
signature=
"e#2014#2289#0"
/>
<element
signature=
"e#2014#2289#0"
/>
<element
signature=
"e#3354#3860#0"
/>
<element
signature=
"e#3354#3860#0"
/>
</folding>
</folding>
...
@@ -466,7 +459,7 @@
...
@@ -466,7 +459,7 @@
<frame
x=
"99"
y=
"31"
width=
"1342"
height=
"727"
extended-state=
"0"
/>
<frame
x=
"99"
y=
"31"
width=
"1342"
height=
"727"
extended-state=
"0"
/>
<editor
active=
"true"
/>
<editor
active=
"true"
/>
<layout>
<layout>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.1650265"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.1650265"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
id=
"Favorites"
order=
"2"
side_tool=
"true"
/>
<window_info
id=
"Favorites"
order=
"2"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Message"
order=
"0"
/>
<window_info
anchor=
"bottom"
id=
"Message"
order=
"0"
/>
...
@@ -477,7 +470,7 @@
...
@@ -477,7 +470,7 @@
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"6"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"6"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"7"
show_stripe_button=
"false"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"7"
show_stripe_button=
"false"
/>
<window_info
a
nchor=
"bottom"
id=
"Terminal"
order=
"8"
weight=
"0.12598425
"
/>
<window_info
a
ctive=
"true"
anchor=
"bottom"
id=
"Terminal"
order=
"8"
visible=
"true"
weight=
"0.36692914
"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"9"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"9"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Python Console"
order=
"10"
/>
<window_info
anchor=
"bottom"
id=
"Python Console"
order=
"10"
/>
<window_info
anchor=
"right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4"
/>
<window_info
anchor=
"right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4"
/>
...
@@ -771,16 +764,16 @@
...
@@ -771,16 +764,16 @@
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/auto_commnet.py"
>
<entry
file=
"file://$PROJECT_DIR$/auto_commnet.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"30
0
"
>
<state
relative-caret-position=
"30
4
"
>
<caret
line=
"
83"
lean-forward=
"true"
selection-start-line=
"83"
selection-end-line=
"83
"
/>
<caret
line=
"
143"
column=
"26"
selection-start-line=
"143"
selection-start-column=
"26"
selection-end-line=
"143"
selection-end-column=
"26
"
/>
<folding>
<folding>
<element
signature=
"e#0#15#0"
expanded=
"true"
/>
<element
signature=
"e#0#15#0"
expanded=
"true"
/>
<element
signature=
"e#279#467#0"
/>
<element
signature=
"e#279#467#0"
/>
<element
signature=
"e#522#891#0"
/>
<element
signature=
"e#522#891#0"
/>
<element
signature=
"e#
763#1552
#0"
/>
<element
signature=
"e#
934#1723
#0"
/>
<element
signature=
"e#1821#2191#0"
/>
<element
signature=
"e#1821#2191#0"
/>
<element
signature=
"e#2284#2495#0"
/>
<element
signature=
"e#2284#2495#0"
/>
<element
signature=
"e#2472#29
79
#0"
/>
<element
signature=
"e#2472#29
55
#0"
/>
<element
signature=
"e#2014#2289#0"
/>
<element
signature=
"e#2014#2289#0"
/>
<element
signature=
"e#3354#3860#0"
/>
<element
signature=
"e#3354#3860#0"
/>
</folding>
</folding>
...
...
auto_commnet.py
View file @
02f87232
...
@@ -5,7 +5,7 @@ import pymysql
...
@@ -5,7 +5,7 @@ import pymysql
import
random
import
random
import
pandas
as
pd
import
pandas
as
pd
import
traceback
import
traceback
from
.
log_settings
import
*
from
log_settings
import
*
import
logging
import
logging
auto_reply_url
=
"http://earth.igengmei.com/api/v1/reply/create"
auto_reply_url
=
"http://earth.igengmei.com/api/v1/reply/create"
...
@@ -18,7 +18,9 @@ def index_first():
...
@@ -18,7 +18,9 @@ def index_first():
r1
=
requests
.
get
(
login_url
)
r1
=
requests
.
get
(
login_url
)
return
r1
.
cookies
.
get_dict
()
return
r1
.
cookies
.
get_dict
()
except
:
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"index_first:
%
s"
%
traceback
.
format_exc
())
return
None
return
None
def
get_majia
():
def
get_majia
():
...
@@ -27,6 +29,7 @@ def get_majia():
...
@@ -27,6 +29,7 @@ def get_majia():
data
=
open
(
"batch user gen"
)
data
=
open
(
"batch user gen"
)
list
=
[]
list
=
[]
for
i
in
data
:
for
i
in
data
:
list
.
append
(
i
.
strip
(
'
\n
'
)
.
strip
(
','
))
list
.
append
(
i
.
strip
(
'
\n
'
)
.
strip
(
','
))
...
@@ -36,15 +39,14 @@ def get_majia():
...
@@ -36,15 +39,14 @@ def get_majia():
user_id
=
list
[
maj
-
1
]
user_id
=
list
[
maj
-
1
]
print
(
user_id
)
return
user_id
return
user_id
except
:
except
:
logging
.
error
(
"catch exception,
err_msg
:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,
get_majia
:
%
s"
%
traceback
.
format_exc
())
return
None
return
None
def
logins
():
def
logins
():
try
:
try
:
# time.sleep(random.randint(300, 500))
# time.sleep(random.randint(300, 500))
...
@@ -52,6 +54,7 @@ def logins():
...
@@ -52,6 +54,7 @@ def logins():
user_id
=
get_majia
()
user_id
=
get_majia
()
cookies
=
index_first
()
cookies
=
index_first
()
if
cookies
is
None
:
if
cookies
is
None
:
logging
.
error
(
"cookies is None!"
)
logging
.
error
(
"cookies is None!"
)
return
None
return
None
...
@@ -78,8 +81,10 @@ def logins():
...
@@ -78,8 +81,10 @@ def logins():
print
(
cook
)
print
(
cook
)
return
{
'sessionid'
:
cook
}
return
{
'sessionid'
:
cook
}
except
:
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
return
None
return
None
def
reply
(
cookies_get
,
id
,
content
):
def
reply
(
cookies_get
,
id
,
content
):
...
@@ -97,7 +102,7 @@ def reply(cookies_get,id,content):
...
@@ -97,7 +102,7 @@ def reply(cookies_get,id,content):
logging
.
info
(
"response.text :
%
s"
%
(
response
.
text
))
logging
.
info
(
"response.text :
%
s"
%
(
response
.
text
))
except
:
except
:
logging
.
error
(
"catch exception,
err_msg
:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,
reply
:
%
s"
%
traceback
.
format_exc
())
def
time_conv
(
numtime
):
def
time_conv
(
numtime
):
...
@@ -110,6 +115,7 @@ def time_conv(numtime):
...
@@ -110,6 +115,7 @@ def time_conv(numtime):
return
None
return
None
def
get_topic_id
(
numtime
):
def
get_topic_id
(
numtime
):
try
:
try
:
db
=
pymysql
.
connect
(
host
=
"rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com"
,
user
=
'work'
,
passwd
=
'Gengmei123'
,
db
=
"alpha"
,
port
=
3306
)
db
=
pymysql
.
connect
(
host
=
"rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com"
,
user
=
'work'
,
passwd
=
'Gengmei123'
,
db
=
"alpha"
,
port
=
3306
)
cursor
=
db
.
cursor
()
cursor
=
db
.
cursor
()
...
@@ -117,8 +123,7 @@ def get_topic_id(numtime):
...
@@ -117,8 +123,7 @@ def get_topic_id(numtime):
cursor
.
execute
(
"SELECT id FROM topic WHERE create_time LIKE '
%%%%%
s
%%%%
' "
%
numtime
)
cursor
.
execute
(
"SELECT id FROM topic WHERE create_time LIKE '
%%%%%
s
%%%%
' "
%
numtime
)
data
=
cursor
.
fetchall
()
data
=
cursor
.
fetchall
()
topic_id
=
list
(
data
)
topic_id
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id
)
print
(
"Database version :
%
s "
%
topic_id
)
db
.
close
()
db
.
close
()
return
topic_id
return
topic_id
except
:
except
:
...
@@ -134,9 +139,6 @@ def get_comment():
...
@@ -134,9 +139,6 @@ def get_comment():
list_guanshui
.
append
(
l
[
0
])
list_guanshui
.
append
(
l
[
0
])
comment
=
list_guanshui
[
num
-
1
]
comment
=
list_guanshui
[
num
-
1
]
print
(
comment
)
return
comment
return
comment
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
@@ -157,10 +159,12 @@ if __name__ == "__main__":
...
@@ -157,10 +159,12 @@ if __name__ == "__main__":
cook
=
logins
()
cook
=
logins
()
if
cook
is
not
None
:
comment
=
get_comment
()
comment
=
get_comment
()
reply
(
cook
,
i
,
comment
)
reply
(
cook
,
i
,
comment
)
except
:
except
:
logging
.
error
(
"catch exception,
err_msg
:
%
s"
%
traceback
.
format_exc
())
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