Commit 53be1169 authored by lixiaofang's avatar lixiaofang

add

parent a840c8d8
...@@ -2,7 +2,7 @@ ...@@ -2,7 +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$/offline_comment.py" beforeDir="false" afterPath="$PROJECT_DIR$/offline_comment.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/instant.py" beforeDir="false" afterPath="$PROJECT_DIR$/instant.py" afterDir="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" />
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
<entry key="comment" value="59" /> <entry key="comment" value="59" />
<entry key="dummy" value="6" /> <entry key="dummy" value="6" />
<entry key="guanshui" value="2" /> <entry key="guanshui" value="2" />
<entry key="py" value="3966" /> <entry key="py" value="4011" />
<entry key="xuqiu" value="223" /> <entry key="xuqiu" value="223" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.types.edit"> <usages-collector id="statistics.file.types.edit">
<counts> <counts>
<entry key="PLAIN_TEXT" value="290" /> <entry key="PLAIN_TEXT" value="290" />
<entry key="Python" value="3966" /> <entry key="Python" value="4011" />
</counts> </counts>
</usages-collector> </usages-collector>
</session> </session>
...@@ -120,17 +120,17 @@ ...@@ -120,17 +120,17 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_at_once.py"> <entry file="file://$PROJECT_DIR$/auto_at_once.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105"> <state relative-caret-position="-11">
<caret line="7" column="22" selection-start-line="7" selection-end-line="8" /> <caret line="7" column="22" selection-start-line="7" selection-end-line="8" />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/instant.py"> <entry file="file://$PROJECT_DIR$/instant.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300"> <state relative-caret-position="789">
<caret line="20" column="63" lean-forward="true" selection-start-line="20" selection-start-column="63" selection-end-line="20" selection-end-column="63" /> <caret line="80" lean-forward="true" selection-start-line="80" selection-end-line="80" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
</folding> </folding>
...@@ -138,14 +138,14 @@ ...@@ -138,14 +138,14 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/offline_comment.py"> <entry file="file://$PROJECT_DIR$/offline_comment.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="321"> <state relative-caret-position="1196">
<caret line="52" column="18" selection-start-line="52" selection-start-column="18" selection-end-line="52" selection-end-column="18" /> <caret line="86" column="27" selection-start-line="86" selection-start-column="27" selection-end-line="86" selection-end-column="27" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
<marker date="1555668230000" expanded="true" signature="1833:1834" ph="..." /> <marker date="1555668385000" expanded="true" signature="1859:1860" ph="..." />
</folding> </folding>
</state> </state>
</provider> </provider>
...@@ -154,8 +154,8 @@ ...@@ -154,8 +154,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_user_id.py"> <entry file="file://$PROJECT_DIR$/auto_user_id.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300"> <state>
<caret line="20" column="19" selection-start-line="20" selection-start-column="19" selection-end-line="20" selection-end-column="19" /> <caret lean-forward="true" />
<folding> <folding>
<element signature="e#1#15#0" expanded="true" /> <element signature="e#1#15#0" expanded="true" />
</folding> </folding>
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_click.py"> <entry file="file://$PROJECT_DIR$/auto_click.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="419"> <state relative-caret-position="420">
<caret line="28" column="8" lean-forward="true" selection-start-line="28" selection-start-column="8" selection-end-line="28" selection-end-column="8" /> <caret line="28" column="8" lean-forward="true" selection-start-line="28" selection-start-column="8" selection-end-line="28" selection-end-column="8" />
<folding> <folding>
<element signature="e#0#11#0" expanded="true" /> <element signature="e#0#11#0" expanded="true" />
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_request.py"> <entry file="file://$PROJECT_DIR$/auto_request.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1062"> <state relative-caret-position="465">
<caret line="31" selection-start-line="31" selection-end-line="31" /> <caret line="31" selection-start-line="31" selection-end-line="31" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
...@@ -284,11 +284,11 @@ ...@@ -284,11 +284,11 @@
<option value="$PROJECT_DIR$/_celery.py" /> <option value="$PROJECT_DIR$/_celery.py" />
<option value="$PROJECT_DIR$/auto_at_once.py" /> <option value="$PROJECT_DIR$/auto_at_once.py" />
<option value="$PROJECT_DIR$/comment.txt" /> <option value="$PROJECT_DIR$/comment.txt" />
<option value="$PROJECT_DIR$/instant.py" />
<option value="$PROJECT_DIR$/auto_user_id.py" /> <option value="$PROJECT_DIR$/auto_user_id.py" />
<option value="$PROJECT_DIR$/auto_request.py" /> <option value="$PROJECT_DIR$/auto_request.py" />
<option value="$PROJECT_DIR$/auto_click.py" /> <option value="$PROJECT_DIR$/auto_click.py" />
<option value="$PROJECT_DIR$/offline_comment.py" /> <option value="$PROJECT_DIR$/offline_comment.py" />
<option value="$PROJECT_DIR$/instant.py" />
</list> </list>
</option> </option>
</component> </component>
...@@ -511,7 +511,7 @@ ...@@ -511,7 +511,7 @@
<layout> <layout>
<window_info id="Structure" order="0" sideWeight="0.21188119" side_tool="true" weight="0.19112115" /> <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 id="Favorites" order="1" side_tool="true" />
<window_info content_ui="combo" id="Project" order="2" sideWeight="0.7872763" visible="true" weight="0.1790416" /> <window_info active="true" content_ui="combo" id="Project" order="2" sideWeight="0.7872763" visible="true" weight="0.1790416" />
<window_info id="DB Browser" order="3" /> <window_info id="DB Browser" order="3" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.3284974" /> <window_info anchor="bottom" id="Find" order="1" weight="0.3284974" />
...@@ -521,7 +521,7 @@ ...@@ -521,7 +521,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 active="true" anchor="bottom" id="Terminal" order="8" visible="true" weight="0.32953367" /> <window_info anchor="bottom" id="Terminal" order="8" visible="true" weight="0.074611396" />
<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="bottom" id="DB Execution Console" order="11" /> <window_info anchor="bottom" id="DB Execution Console" order="11" />
...@@ -874,29 +874,40 @@ ...@@ -874,29 +874,40 @@
<entry file="file://$PROJECT_DIR$/user_id.txt"> <entry file="file://$PROJECT_DIR$/user_id.txt">
<provider selected="true" editor-type-id="text-editor" /> <provider selected="true" editor-type-id="text-editor" />
</entry> </entry>
<entry file="file://$PROJECT_DIR$/instant.py"> <entry file="file://$PROJECT_DIR$/offline_comment.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300"> <state relative-caret-position="1196">
<caret line="20" column="63" lean-forward="true" selection-start-line="20" selection-start-column="63" selection-end-line="20" selection-end-column="63" /> <caret line="86" column="27" selection-start-line="86" selection-start-column="27" selection-end-line="86" selection-end-column="27" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
<marker date="1555668385000" expanded="true" signature="1859:1860" ph="..." />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/auto_user_id.py"> <entry file="file://$PROJECT_DIR$/auto_user_id.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300"> <state>
<caret line="20" column="19" selection-start-line="20" selection-start-column="19" selection-end-line="20" selection-end-column="19" /> <caret lean-forward="true" />
<folding> <folding>
<element signature="e#1#15#0" expanded="true" /> <element signature="e#1#15#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/auto_click.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="28" column="8" lean-forward="true" selection-start-line="28" selection-start-column="8" selection-end-line="28" selection-end-column="8" />
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_request.py"> <entry file="file://$PROJECT_DIR$/auto_request.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1062"> <state relative-caret-position="465">
<caret line="31" selection-start-line="31" selection-end-line="31" /> <caret line="31" selection-start-line="31" selection-end-line="31" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
...@@ -911,23 +922,6 @@ ...@@ -911,23 +922,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/auto_at_once.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="7" column="22" selection-start-line="7" selection-end-line="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_click.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="419">
<caret line="28" column="8" lean-forward="true" selection-start-line="28" selection-start-column="8" selection-end-line="28" selection-end-column="8" />
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_click_n.py"> <entry file="file://$PROJECT_DIR$/auto_click_n.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="735"> <state relative-caret-position="735">
...@@ -938,13 +932,19 @@ ...@@ -938,13 +932,19 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/offline_comment.py"> <entry file="file://$PROJECT_DIR$/auto_at_once.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-11">
<caret line="7" column="22" selection-start-line="7" selection-end-line="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/instant.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="321"> <state relative-caret-position="789">
<caret line="52" column="18" selection-start-line="52" selection-start-column="18" selection-end-line="52" selection-end-column="18" /> <caret line="80" lean-forward="true" selection-start-line="80" selection-end-line="80" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
<marker date="1555668230000" expanded="true" signature="1833:1834" ph="..." />
</folding> </folding>
</state> </state>
</provider> </provider>
......
...@@ -7,7 +7,7 @@ import pandas as pd ...@@ -7,7 +7,7 @@ import pandas as pd
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import get_offline_comment, login, click from auto_request import login, click,get_comments,reply
import threading import threading
from auto_request import host, user, db, passwd from auto_request import host, user, db, passwd
...@@ -18,7 +18,8 @@ if __name__ == "__main__": ...@@ -18,7 +18,8 @@ if __name__ == "__main__":
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT id,user_id FROM topic WHERE id = " + str(927745) + " and user_id in (select user_id from user_extra where is_shadow = 0)") "SELECT id,user_id FROM topic WHERE id = " + str(
id) + " and user_id in (select user_id from user_extra where is_shadow = 0)")
data = cursor.fetchall() data = cursor.fetchall()
topic_id_list = list(data) topic_id_list = list(data)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
...@@ -28,10 +29,35 @@ if __name__ == "__main__": ...@@ -28,10 +29,35 @@ if __name__ == "__main__":
exec_count = 0 exec_count = 0
if topic_id_list: if topic_id_list:
def fun_comment():
cookies = login()
if cookies:
comment_content = get_comments()
comment = comment_content[0]
reply(cookies, id, comment)
global timer
global exec_count
exec_count += 1
if exec_count == 1:
sleep_time = random.randint(300, 540)
sleep_time = 30
timer = threading.Timer(sleep_time, fun_comment)
timer.start()
if exec_count == 2:
sleep_time = random.randint(1000, 1900)
sleep_time = 30
timer = threading.Timer(sleep_time, fun_comment)
timer.start()
def fun_timer(): def fun_timer():
cookies = login() cookies = login()
if cookies: if cookies:
click(cookies, topic_id_list) click(cookies, topic_id_list[0])
global timer global timer
global exec_count global exec_count
...@@ -49,7 +75,11 @@ if __name__ == "__main__": ...@@ -49,7 +75,11 @@ if __name__ == "__main__":
timer.start() 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 = threading.Timer(10, fun_timer) # 首次启动
timer.start() timer.start()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment