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
61f0ada2
Commit
61f0ada2
authored
Jul 22, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
d62d40fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
63 deletions
+122
-63
workspace.xml
.idea/workspace.xml
+82
-59
answer_reply1.py
answer_reply1.py
+8
-4
auto_request.py
auto_request.py
+32
-0
No files found.
.idea/workspace.xml
View file @
61f0ada2
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"7b835479-ee84-40d6-9b97-0e9285d92119"
name=
"Default Changelist"
comment=
""
/>
<list
default=
"true"
id=
"7b835479-ee84-40d6-9b97-0e9285d92119"
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$/answer_reply1.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/answer_reply1.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/auto_request.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/auto_request.py"
afterDir=
"false"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -13,26 +17,27 @@
<usages-collector
id=
"statistics.file.extensions.open"
>
<counts>
<entry
key=
"README"
value=
"1"
/>
<entry
key=
"py"
value=
"36"
/>
<entry
key=
"batch_user_gen"
value=
"1"
/>
<entry
key=
"py"
value=
"38"
/>
<entry
key=
"txt"
value=
"3"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.types.open"
>
<counts>
<entry
key=
"PLAIN_TEXT"
value=
"
4
"
/>
<entry
key=
"Python"
value=
"3
6
"
/>
<entry
key=
"PLAIN_TEXT"
value=
"
5
"
/>
<entry
key=
"Python"
value=
"3
8
"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.extensions.edit"
>
<counts>
<entry
key=
"dummy"
value=
"1"
/>
<entry
key=
"py"
value=
"1
776
"
/>
<entry
key=
"py"
value=
"1
928
"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.file.types.edit"
>
<counts>
<entry
key=
"PLAIN_TEXT"
value=
"1"
/>
<entry
key=
"Python"
value=
"1
776
"
/>
<entry
key=
"Python"
value=
"1
928
"
/>
</counts>
</usages-collector>
<usages-collector
id=
"statistics.lifecycle.project"
>
...
...
@@ -47,18 +52,24 @@
</component>
<component
name=
"FileEditorManager"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/auto_request.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
90
"
>
<caret
line=
"
17"
column=
"40"
selection-start-line=
"17"
selection-start-column=
"37"
selection-end-line=
"17"
selection-end-column=
"40
"
/>
<state
relative-caret-position=
"
219
"
>
<caret
line=
"
52"
column=
"22"
selection-start-line=
"52"
selection-start-column=
"22"
selection-end-line=
"52"
selection-end-column=
"22
"
/>
<folding>
<element
signature=
"e#0#15#0"
expanded=
"true"
/>
<marker
date=
"1563777222000"
expanded=
"true"
signature=
"1500:1502"
ph=
"..."
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/batch_user_gen"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/test.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
...
...
@@ -84,11 +95,29 @@
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/index_contrast/user.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1268"
>
<caret
line=
"366"
column=
"23"
selection-start-line=
"366"
selection-start-column=
"23"
selection-end-line=
"366"
selection-end-column=
"23"
/>
<state
relative-caret-position=
"439"
>
<caret
line=
"314"
column=
"40"
lean-forward=
"true"
selection-start-line=
"314"
selection-start-column=
"40"
selection-end-line=
"314"
selection-end-column=
"40"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/index_contrast/pictorial.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"228"
>
<caret
line=
"194"
column=
"67"
selection-start-line=
"194"
selection-start-column=
"67"
selection-end-line=
"194"
selection-end-column=
"67"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/answer_reply1.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"105"
>
<caret
line=
"7"
column=
"29"
selection-start-line=
"7"
selection-start-column=
"14"
selection-end-line=
"7"
selection-end-column=
"29"
/>
</state>
</provider>
</entry>
...
...
@@ -142,6 +171,8 @@
<find>
tag_list
</find>
<find>
mv-alpha-tag-test-190711901
</find>
<find>
latest_topic_time_val
</find>
<find>
mv-alpha-tag-test-190718901
</find>
<find>
mv-alpha-pictorial-test-190717904
</find>
</findStrings>
</component>
<component
name=
"Git.Settings"
>
...
...
@@ -155,23 +186,22 @@
<option
value=
"$PROJECT_DIR$/answer_reply.py"
/>
<option
value=
"$PROJECT_DIR$/answer_reply3.py"
/>
<option
value=
"$PROJECT_DIR$/answer_reply2.py"
/>
<option
value=
"$PROJECT_DIR$/auto_request.py"
/>
<option
value=
"$PROJECT_DIR$/reply_comment2.py"
/>
<option
value=
"$PROJECT_DIR$/reply_comment3.py"
/>
<option
value=
"$PROJECT_DIR$/reply_comment1.py"
/>
<option
value=
"$PROJECT_DIR$/answer_reply1.py"
/>
<option
value=
"$PROJECT_DIR$/index_contrast/pictorial.py"
/>
<option
value=
"$PROJECT_DIR$/index_contrast/user.py"
/>
<option
value=
"$PROJECT_DIR$/test.py"
/>
<option
value=
"$PROJECT_DIR$/index_contrast/tag.py"
/>
<option
value=
"$PROJECT_DIR$/index_contrast/user.py"
/>
<option
value=
"$PROJECT_DIR$/index_contrast/pictorial.py"
/>
<option
value=
"$PROJECT_DIR$/answer_reply1.py"
/>
<option
value=
"$PROJECT_DIR$/auto_request.py"
/>
</list>
</option>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"-323"
/>
<option
name=
"y"
value=
"-1080"
/>
<option
name=
"width"
value=
"1920"
/>
<option
name=
"height"
value=
"1080"
/>
<option
name=
"y"
value=
"23"
/>
<option
name=
"width"
value=
"1280"
/>
<option
name=
"height"
value=
"727"
/>
</component>
<component
name=
"ProjectView"
>
<navigator
proportions=
""
version=
"1"
>
...
...
@@ -252,12 +282,12 @@
<servers
/>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"
-323"
y=
"-1080"
width=
"1920"
height=
"1080
"
extended-state=
"6"
/>
<frame
x=
"
0"
y=
"23"
width=
"1280"
height=
"727
"
extended-state=
"6"
/>
<editor
active=
"true"
/>
<layout>
<window_info
id=
"Structure"
order=
"0"
sideWeight=
"0.21188119"
side_tool=
"true"
weight=
"0.19112115"
/>
<window_info
id=
"Favorites"
order=
"1"
side_tool=
"true"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"2"
sideWeight=
"0.7872763"
visible=
"true"
weight=
"0.
21537651
"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"2"
sideWeight=
"0.7872763"
visible=
"true"
weight=
"0.
15329626
"
/>
<window_info
id=
"DB Browser"
order=
"3"
/>
<window_info
anchor=
"bottom"
id=
"Message"
order=
"0"
/>
<window_info
anchor=
"bottom"
id=
"Find"
order=
"1"
weight=
"0.3284974"
/>
...
...
@@ -494,13 +524,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/answer_reply1.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"536"
>
<caret
line=
"80"
selection-start-line=
"80"
selection-end-line=
"80"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/reply_comment1.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"39"
>
...
...
@@ -531,34 +554,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/index_contrast/pictorial.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"93"
>
<caret
line=
"311"
selection-start-line=
"311"
selection-end-line=
"318"
selection-end-column=
"5"
/>
<folding>
<element
signature=
"e#382#16835#0"
/>
<element
signature=
"e#530#960#0"
/>
<element
signature=
"e#1648#2194#0"
/>
<element
signature=
"e#2272#3153#0"
/>
<element
signature=
"e#3275#4024#0"
/>
<element
signature=
"e#4129#4630#0"
/>
<element
signature=
"e#4762#6096#0"
/>
<element
signature=
"e#8486#9071#0"
/>
<element
signature=
"e#9141#10450#0"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/auto_request.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"90"
>
<caret
line=
"17"
column=
"40"
selection-start-line=
"17"
selection-start-column=
"37"
selection-end-line=
"17"
selection-end-column=
"40"
/>
<folding>
<element
signature=
"e#0#15#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$USER_HOME$/.local/lib/python3.6/site-packages/requests/__init__.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
...
...
@@ -603,8 +598,36 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/index_contrast/user.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1268"
>
<caret
line=
"366"
column=
"23"
selection-start-line=
"366"
selection-start-column=
"23"
selection-end-line=
"366"
selection-end-column=
"23"
/>
<state
relative-caret-position=
"439"
>
<caret
line=
"314"
column=
"40"
lean-forward=
"true"
selection-start-line=
"314"
selection-start-column=
"40"
selection-end-line=
"314"
selection-end-column=
"40"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/index_contrast/pictorial.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"228"
>
<caret
line=
"194"
column=
"67"
selection-start-line=
"194"
selection-start-column=
"67"
selection-end-line=
"194"
selection-end-column=
"67"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/answer_reply1.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"105"
>
<caret
line=
"7"
column=
"29"
selection-start-line=
"7"
selection-start-column=
"14"
selection-end-line=
"7"
selection-end-column=
"29"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/batch_user_gen"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/auto_request.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"219"
>
<caret
line=
"52"
column=
"22"
selection-start-line=
"52"
selection-start-column=
"22"
selection-end-line=
"52"
selection-end-column=
"22"
/>
<folding>
<element
signature=
"e#0#15#0"
expanded=
"true"
/>
<marker
date=
"1563777222000"
expanded=
"true"
signature=
"1500:1502"
ph=
"..."
/>
</folding>
</state>
</provider>
</entry>
...
...
answer_reply1.py
View file @
61f0ada2
...
...
@@ -4,7 +4,8 @@ import logging
import
datetime
import
json
from
log_settings
import
*
from
auto_request
import
login
,
time_conv_minute
,
get_answer_data
,
reply_answer
,
set_reply_to_redis
,
reply2
from
auto_request
import
login
,
time_conv_minute
,
get_answer_data
,
reply_answer
,
set_reply_to_redis
,
reply2
,
logins
,
\
get_majia
,
get_majia_reply
from
auto_request
import
host
,
user
,
db
,
passwd
...
...
@@ -49,7 +50,8 @@ if __name__ == "__main__":
reply_data_comment
=
[]
if
user_id
:
for
i
in
user_id
:
cook
=
login
()
majia_user_id
=
get_majia
()
cook
=
logins
(
majia_user_id
)
comment1
,
comment2
=
get_answer_data
()
logging
.
info
(
"get comment1:
%
s"
%
comment1
)
logging
.
info
(
"get comment2:
%
s"
%
comment2
)
...
...
@@ -61,7 +63,8 @@ if __name__ == "__main__":
reply_user_id
=
data_dict
[
"data"
][
"user"
][
"id"
]
topic_id
=
i
[
1
]
reply_data_comment
.
append
(
{
"id"
:
reply_id
,
"reply_user_id"
:
reply_user_id
,
"answer"
:
comment2
,
"topic_id"
:
topic_id
})
{
"id"
:
reply_id
,
"reply_user_id"
:
reply_user_id
,
"answer"
:
comment2
,
"topic_id"
:
topic_id
,
"majia_user_id"
:
majia_user_id
})
redis_client
=
set_reply_to_redis
()
redis_client
.
hset
(
redis_key1
,
str
(
minute
),
json
.
dumps
(
reply_data_comment
))
...
...
@@ -73,7 +76,8 @@ if __name__ == "__main__":
redis_client
.
hdel
(
redis_key1
,
str
(
minute
-
5
))
if
result
:
for
item
in
result
:
cook
=
login
()
majia_user_id
=
get_majia_reply
(
item
[
"majia_user_id"
])
cook
=
logins
(
majia_user_id
)
reply2
(
cook
,
item
[
"topic_id"
],
item
[
"answer"
],
item
[
"id"
])
except
:
...
...
auto_request.py
View file @
61f0ada2
...
...
@@ -46,6 +46,22 @@ db = DATABASES['default']['NAME']
passwd
=
DATABASES
[
'default'
][
'PASSWORD'
]
def
get_majia_reply
(
user_id
):
try
:
data
=
open
(
"/srv/apps/cybertron/batch_user_gen"
)
list
=
[]
for
i
in
data
:
if
i
!=
user_id
:
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_majia
():
try
:
data
=
open
(
"/srv/apps/cybertron/batch_user_gen"
)
...
...
@@ -98,6 +114,22 @@ def login():
return
None
def
logins
(
user_id
):
try
:
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
=
{
...
...
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