Commit 70c3373d authored by lixiaofang's avatar lixiaofang

a

parent 16db11dd
......@@ -2,13 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="fd1f0b61-1139-44e5-87e7-f8b86ff52376" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/save_topic_id_comment_three.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_click2.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_click2.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_click3.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_click3.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_comment1.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_comment1.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_comment2.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_comment2.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_comment3.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_comment3.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
......@@ -49,7 +44,7 @@
<entry key="comment" value="59" />
<entry key="dummy" value="7" />
<entry key="guanshui" value="2" />
<entry key="py" value="7547" />
<entry key="py" value="7548" />
<entry key="txt" value="86" />
<entry key="xuqiu" value="223" />
</counts>
......@@ -57,7 +52,7 @@
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="PLAIN_TEXT" value="377" />
<entry key="Python" value="7547" />
<entry key="Python" value="7548" />
</counts>
</usages-collector>
</session>
......@@ -138,7 +133,7 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_click2.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
......@@ -162,11 +157,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/auto_comment1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-513">
<caret line="17" column="29" lean-forward="true" selection-start-line="17" selection-start-column="29" selection-end-line="17" selection-end-column="29" />
<state relative-caret-position="199">
<caret line="15" column="96" selection-start-line="15" selection-start-column="96" selection-end-line="15" selection-end-column="96" />
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
......@@ -319,12 +314,12 @@
<option value="$PROJECT_DIR$/save_topic_id_comment_three.txt" />
<option value="$PROJECT_DIR$/auto_comment3.py" />
<option value="$PROJECT_DIR$/auto_comment2.py" />
<option value="$PROJECT_DIR$/auto_comment1.py" />
<option value="$PROJECT_DIR$/auto_click2.py" />
<option value="$PROJECT_DIR$/auto_comment1.py" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="1">
<component name="ProjectFrameBounds">
<option name="y" value="23" />
<option name="width" value="1280" />
<option name="height" value="724" />
......@@ -537,21 +532,21 @@
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1280" height="724" extended-state="1" />
<frame x="0" y="23" width="1280" height="724" extended-state="0" />
<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.17871326" />
<window_info content_ui="combo" id="Project" order="2" sideWeight="0.7872763" visible="true" weight="0.17871326" />
<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" />
<window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.0" />
<window_info anchor="bottom" id="Run" order="2" weight="0.0" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.5632184" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<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 anchor="bottom" id="Terminal" order="8" weight="0.027914613" />
<window_info active="true" anchor="bottom" id="Terminal" order="8" visible="true" weight="0.28407225" />
<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" />
......@@ -866,20 +861,20 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_comment1.py">
<entry file="file://$PROJECT_DIR$/auto_click2.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-513">
<caret line="17" column="29" lean-forward="true" selection-start-line="17" selection-start-column="29" selection-end-line="17" selection-end-column="29" />
<state relative-caret-position="165">
<caret line="11" lean-forward="true" selection-start-line="11" selection-end-line="11" />
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_click2.py">
<entry file="file://$PROJECT_DIR$/auto_comment1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" lean-forward="true" selection-start-line="11" selection-end-line="11" />
<state relative-caret-position="199">
<caret line="15" column="96" selection-start-line="15" selection-start-column="96" selection-end-line="15" selection-end-column="96" />
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
......
......@@ -8,12 +8,12 @@ from auto_request import login, click, time_conv
from auto_request import host, user, db, passwd
def get_data(numtime):
def get_data(numtime,numtime2):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT user_id,id FROM topic WHERE is_online=1 and create_time > '%s'" % numtime)
"SELECT user_id,id FROM topic WHERE is_online=1 and (create_time > '%s' and create_time < '%s')" % (numtime,numtime2))
data = cursor.fetchall()
topic_id = list(data)
topic_id_list = []
......@@ -55,8 +55,8 @@ if __name__ == "__main__":
try:
numtime = time_conv(10)
user_id = get_data(numtime)
numtime,numtime2 = time_conv(15,5)
user_id = get_data(numtime,numtime)
dicts = {}
if user_id:
......
......@@ -13,7 +13,7 @@ def get_data(numtime):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT user_id,id FROM topic WHERE is_online=1 and create_time > '%s'" % numtime)
"SELECT user_id,id FROM topic WHERE is_online=1 and create_time > '%s'" % numtime )
data = cursor.fetchall()
topic_id = list(data)
topic_id_list = []
......
......@@ -145,11 +145,12 @@ def reply(cookies_get, id, content):
logging.error("catch exception,logins:%s" % traceback.format_exc())
def time_conv(minutest):
def time_conv(minutest,minutest2):
try:
now = datetime.datetime.now()
yes_time = now - datetime.timedelta(minutes=minutest)
return yes_time
yes_time2 = now - datetime.timedelta(minutes=minutest2)
return yes_time,yes_time2
except:
return None
......
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