Commit 53be1169 authored by lixiaofang's avatar lixiaofang

add

parent a840c8d8
......@@ -2,7 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<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>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
......@@ -42,14 +42,14 @@
<entry key="comment" value="59" />
<entry key="dummy" value="6" />
<entry key="guanshui" value="2" />
<entry key="py" value="3966" />
<entry key="py" value="4011" />
<entry key="xuqiu" value="223" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="PLAIN_TEXT" value="290" />
<entry key="Python" value="3966" />
<entry key="Python" value="4011" />
</counts>
</usages-collector>
</session>
......@@ -120,17 +120,17 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_at_once.py">
<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" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/instant.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300">
<caret line="20" column="63" lean-forward="true" selection-start-line="20" selection-start-column="63" selection-end-line="20" selection-end-column="63" />
<state relative-caret-position="789">
<caret line="80" lean-forward="true" selection-start-line="80" selection-end-line="80" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
......@@ -138,14 +138,14 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/offline_comment.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="321">
<caret line="52" column="18" selection-start-line="52" selection-start-column="18" selection-end-line="52" selection-end-column="18" />
<state relative-caret-position="1196">
<caret line="86" column="27" selection-start-line="86" selection-start-column="27" selection-end-line="86" selection-end-column="27" />
<folding>
<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>
</state>
</provider>
......@@ -154,8 +154,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_user_id.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300">
<caret line="20" column="19" selection-start-line="20" selection-start-column="19" selection-end-line="20" selection-end-column="19" />
<state>
<caret lean-forward="true" />
<folding>
<element signature="e#1#15#0" expanded="true" />
</folding>
......@@ -166,7 +166,7 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_click.py">
<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" />
<folding>
<element signature="e#0#11#0" expanded="true" />
......@@ -178,7 +178,7 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_request.py">
<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" />
<folding>
<element signature="e#0#15#0" expanded="true" />
......@@ -284,11 +284,11 @@
<option value="$PROJECT_DIR$/_celery.py" />
<option value="$PROJECT_DIR$/auto_at_once.py" />
<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_request.py" />
<option value="$PROJECT_DIR$/auto_click.py" />
<option value="$PROJECT_DIR$/offline_comment.py" />
<option value="$PROJECT_DIR$/instant.py" />
</list>
</option>
</component>
......@@ -511,7 +511,7 @@
<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 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 anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.3284974" />
......@@ -521,7 +521,7 @@
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<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="Python Console" order="10" />
<window_info anchor="bottom" id="DB Execution Console" order="11" />
......@@ -874,29 +874,40 @@
<entry file="file://$PROJECT_DIR$/user_id.txt">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/instant.py">
<entry file="file://$PROJECT_DIR$/offline_comment.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300">
<caret line="20" column="63" lean-forward="true" selection-start-line="20" selection-start-column="63" selection-end-line="20" selection-end-column="63" />
<state relative-caret-position="1196">
<caret line="86" column="27" selection-start-line="86" selection-start-column="27" selection-end-line="86" selection-end-column="27" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<marker date="1555668385000" expanded="true" signature="1859:1860" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_user_id.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300">
<caret line="20" column="19" selection-start-line="20" selection-start-column="19" selection-end-line="20" selection-end-column="19" />
<state>
<caret lean-forward="true" />
<folding>
<element signature="e#1#15#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<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" />
<folding>
<element signature="e#0#15#0" expanded="true" />
......@@ -911,23 +922,6 @@
</state>
</provider>
</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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="735">
......@@ -938,13 +932,19 @@
</state>
</provider>
</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">
<state relative-caret-position="321">
<caret line="52" column="18" selection-start-line="52" selection-start-column="18" selection-end-line="52" selection-end-column="18" />
<state relative-caret-position="789">
<caret line="80" lean-forward="true" selection-start-line="80" selection-end-line="80" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<marker date="1555668230000" expanded="true" signature="1833:1834" ph="..." />
</folding>
</state>
</provider>
......
......@@ -7,7 +7,7 @@ import pandas as pd
import traceback
from log_settings import *
import logging
from auto_request import get_offline_comment, login, click
from auto_request import login, click,get_comments,reply
import threading
from auto_request import host, user, db, passwd
......@@ -18,7 +18,8 @@ if __name__ == "__main__":
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
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()
topic_id_list = list(data)
logging.info("Database version : %s " % topic_id_list)
......@@ -28,10 +29,35 @@ if __name__ == "__main__":
exec_count = 0
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():
cookies = login()
if cookies:
click(cookies, topic_id_list)
click(cookies, topic_id_list[0])
global timer
global exec_count
......@@ -49,7 +75,11 @@ if __name__ == "__main__":
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.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