Commit 6050947b authored by lixiaofang's avatar lixiaofang

add

parent 77f4e958
......@@ -7,17 +7,7 @@
<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_every_day.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_every_day.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_follow.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_follow.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$/auto_follow_new.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_follow_new.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_follow_one.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_follow_one.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_lunch_app.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_lunch_app.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_star_topic.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_star_topic.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_star_urge.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_star_urge.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_urge.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_urge.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/auto_urge_three.py" beforeDir="false" afterPath="$PROJECT_DIR$/auto_urge_three.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test.py" beforeDir="false" afterPath="$PROJECT_DIR$/test.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" />
......@@ -41,7 +31,7 @@
<entry key="batch_user_gen" value="2" />
<entry key="comment" value="2" />
<entry key="guanshui" value="2" />
<entry key="py" value="73" />
<entry key="py" value="90" />
<entry key="txt" value="1" />
<entry key="xuqiu" value="2" />
</counts>
......@@ -49,21 +39,22 @@
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="PLAIN_TEXT" value="9" />
<entry key="Python" value="73" />
<entry key="Python" value="90" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="comment" value="59" />
<entry key="dummy" value="1" />
<entry key="guanshui" value="2" />
<entry key="py" value="1388" />
<entry key="py" value="2146" />
<entry key="xuqiu" value="223" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="PLAIN_TEXT" value="284" />
<entry key="Python" value="1388" />
<entry key="PLAIN_TEXT" value="285" />
<entry key="Python" value="2146" />
</counts>
</usages-collector>
</session>
......@@ -130,103 +121,50 @@
</session>
</component>
<component name="FileEditorManager">
<splitter split-orientation="horizontal" split-proportion="0.49599013">
<split-first>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<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="2280">
<caret line="152" lean-forward="true" selection-start-line="152" selection-end-line="152" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_lunch_app.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="720">
<caret line="132" selection-start-line="132" selection-end-line="132" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#133#193#0" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_click_n.py">
<entry file="file://$PROJECT_DIR$/offline_comment.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="98" column="50" lean-forward="true" selection-start-line="98" selection-end-line="99" />
<state relative-caret-position="435">
<caret line="29" column="36" selection-start-line="29" selection-start-column="36" selection-end-line="29" selection-end-column="36" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#164#182#0" />
<element signature="e#1#16#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_follow_majia.py">
<entry file="file://$PROJECT_DIR$/auto_user_id.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="80" column="47" lean-forward="true" selection-start-line="80" selection-end-line="81" />
<state relative-caret-position="525">
<caret line="35" selection-start-line="35" selection-end-line="35" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#154#211#0" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_star_topic.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="137" column="24" lean-forward="true" selection-start-line="137" selection-end-line="138" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#133#193#0" />
<element signature="e#2500#3221#0" />
<element signature="e#3941#4910#0" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_star_urge.py">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="15" lean-forward="true" selection-start-column="15" selection-end-column="15" />
<folding>
<element signature="e#266#327#0" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_urge.py">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/auto_request.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="103" column="54" selection-start-line="103" selection-end-line="104" />
<state relative-caret-position="353">
<caret line="34" column="7" selection-start-line="34" selection-start-column="7" selection-end-line="34" selection-end-column="7" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#152#213#0" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test.py">
<entry file="file://$PROJECT_DIR$/auto_click_n.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="34" selection-start-line="4" selection-start-column="34" selection-end-line="4" selection-end-column="34" />
<state relative-caret-position="790">
<caret line="153" selection-start-line="153" selection-end-line="153" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
......@@ -235,23 +173,26 @@
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_urge_three.py">
<entry file="file://$PROJECT_DIR$/auto_commnet.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="690">
<caret line="127" column="28" selection-start-line="127" selection-start-column="28" selection-end-line="127" selection-end-column="28" />
<state relative-caret-position="760">
<caret line="145" selection-start-line="145" selection-end-line="145" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#194#196#0" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</split-first>
<split-second>
<leaf>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/auto_request.py">
<entry file="file://$PROJECT_DIR$/auto_at_once.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="480">
<caret line="32" lean-forward="true" selection-start-line="32" selection-end-line="32" />
<state relative-caret-position="1149">
<caret line="179" lean-forward="true" selection-start-line="179" selection-end-line="179" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
......@@ -260,6 +201,8 @@
</entry>
</file>
</leaf>
</split-second>
</splitter>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
......@@ -316,10 +259,6 @@
<option value="$PROJECT_DIR$/epp_scripts/test1.py" />
<option value="$PROJECT_DIR$/epp_scripts/test2.py" />
<option value="$PROJECT_DIR$/mysql_config.py" />
<option value="$PROJECT_DIR$/auto_click.py" />
<option value="$PROJECT_DIR$/auto_at_once.py" />
<option value="$PROJECT_DIR$/auto_click_n.py" />
<option value="$PROJECT_DIR$/auto_commnet.py" />
<option value="$PROJECT_DIR$/auto_every_day.py" />
<option value="$PROJECT_DIR$/auto_follow.py" />
<option value="$PROJECT_DIR$/auto_follow_majia.py" />
......@@ -331,6 +270,13 @@
<option value="$PROJECT_DIR$/auto_urge.py" />
<option value="$PROJECT_DIR$/auto_urge_three.py" />
<option value="$PROJECT_DIR$/test.py" />
<option value="$PROJECT_DIR$/offline)comment.py" />
<option value="$PROJECT_DIR$/auto_click.py" />
<option value="$PROJECT_DIR$/offline_comment.py" />
<option value="$PROJECT_DIR$/auto_user_id.py" />
<option value="$PROJECT_DIR$/auto_click_n.py" />
<option value="$PROJECT_DIR$/auto_commnet.py" />
<option value="$PROJECT_DIR$/auto_at_once.py" />
<option value="$PROJECT_DIR$/auto_request.py" />
</list>
</option>
......@@ -552,7 +498,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.1421801" />
<window_info content_ui="combo" id="Project" order="2" sideWeight="0.7872763" visible="true" weight="0.14639284" />
<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.32909092" />
......@@ -562,7 +508,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.2601036" />
<window_info active="true" anchor="bottom" id="Terminal" order="8" visible="true" weight="0.3326425" />
<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" />
......@@ -571,20 +517,22 @@
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
<layout-to-restore>
<window_info id="Structure" order="0" sideWeight="0.21188119" side_tool="true" visible="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 active="true" content_ui="combo" id="Project" order="2" sideWeight="0.7872763" visible="true" weight="0.19112115" />
<window_info active="true" content_ui="combo" id="Project" order="2" sideWeight="0.7872763" visible="true" weight="0.22081016" />
<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.32909092" />
<window_info anchor="bottom" id="Run" order="2" weight="0.36348686" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.46830985" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.56363636" />
<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" visible="true" weight="0.11443662" />
<window_info anchor="bottom" id="Terminal" order="8" visible="true" weight="0.15106732" />
<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" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
......@@ -598,7 +546,7 @@
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/auto_click_n.py</url>
<line>12</line>
<line>9</line>
<option name="timeStamp" value="2" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
......@@ -730,17 +678,6 @@
<entry file="file://$PROJECT_DIR$/mysql_config.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/auto_click.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="104" column="10" selection-start-line="104" selection-start-column="10" selection-end-line="104" selection-end-column="10" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#216#234#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/user_session.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="311">
......@@ -748,18 +685,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_commnet.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" selection-start-line="7" selection-end-line="9" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#205#270#0" />
<element signature="e#2967#3871#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_every_day.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
......@@ -804,36 +729,62 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_click_n.py">
<entry file="file://$PROJECT_DIR$/auto_star_urge.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="98" column="50" lean-forward="true" selection-start-line="98" selection-end-line="99" />
<state>
<caret column="15" lean-forward="true" selection-start-column="15" selection-end-column="15" />
<folding>
<element signature="e#266#327#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/batch_user_gen">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="758">
<caret line="299" column="3" selection-start-line="299" selection-start-column="3" selection-end-line="299" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_follow_majia.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="80" column="47" lean-forward="true" selection-start-line="80" selection-end-line="81" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#164#182#0" />
<element signature="e#154#211#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_star_topic.py">
<entry file="file://$PROJECT_DIR$/auto_lunch_app.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="137" column="24" lean-forward="true" selection-start-line="137" selection-end-line="138" />
<state relative-caret-position="720">
<caret line="132" selection-start-line="132" selection-end-line="132" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#133#193#0" />
<element signature="e#2500#3221#0" />
<element signature="e#3941#4910#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_star_urge.py">
<entry file="file://$PROJECT_DIR$/auto_urge.py">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="15" lean-forward="true" selection-start-column="15" selection-end-column="15" />
<state relative-caret-position="240">
<caret line="103" column="54" selection-start-line="103" selection-end-line="104" />
<folding>
<element signature="e#266#327#0" />
<element signature="e#0#15#0" expanded="true" />
<element signature="e#152#213#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="34" selection-start-line="4" selection-start-column="34" selection-end-line="4" selection-end-column="34" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
</state>
</provider>
......@@ -844,75 +795,84 @@
<caret line="127" column="28" selection-start-line="127" selection-start-column="28" selection-end-line="127" selection-end-column="28" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#194#196#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/batch_user_gen">
<entry file="file://$PROJECT_DIR$/auto_star_topic.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="758">
<caret line="299" column="3" selection-start-line="299" selection-start-column="3" selection-end-line="299" selection-end-column="4" />
<state relative-caret-position="-4">
<caret line="140" column="93" selection-start-line="140" selection-start-column="57" selection-end-line="140" selection-end-column="93" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_follow_majia.py">
<entry file="file://$PROJECT_DIR$/auto_click.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="80" column="47" lean-forward="true" selection-start-line="80" selection-end-line="81" />
<state relative-caret-position="2025">
<caret line="135" selection-start-line="135" selection-end-line="135" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#154#211#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_at_once.py">
<entry file="file://$PROJECT_DIR$/auto_click_n.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2280">
<caret line="152" lean-forward="true" selection-start-line="152" selection-end-line="152" />
<state relative-caret-position="790">
<caret line="153" selection-start-line="153" selection-end-line="153" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_lunch_app.py">
<entry file="file://$PROJECT_DIR$/auto_user_id.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="720">
<caret line="132" selection-start-line="132" selection-end-line="132" />
<state relative-caret-position="525">
<caret line="35" selection-start-line="35" selection-end-line="35" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#133#193#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test.py">
<entry file="file://$PROJECT_DIR$/auto_commnet.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="34" selection-start-line="4" selection-start-column="34" selection-end-line="4" selection-end-column="34" />
<state relative-caret-position="760">
<caret line="145" selection-start-line="145" selection-end-line="145" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/auto_urge.py">
<entry file="file://$PROJECT_DIR$/auto_at_once.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="103" column="54" selection-start-line="103" selection-end-line="104" />
<state relative-caret-position="1149">
<caret line="179" lean-forward="true" selection-start-line="179" selection-end-line="179" />
<folding>
<element signature="e#0#15#0" expanded="true" />
<element signature="e#152#213#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/offline_comment.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="435">
<caret line="29" column="36" selection-start-line="29" selection-start-column="36" selection-end-line="29" selection-end-column="36" />
<folding>
<element signature="e#1#16#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="480">
<caret line="32" lean-forward="true" selection-start-line="32" selection-end-line="32" />
<state relative-caret-position="353">
<caret line="34" column="7" selection-start-line="34" selection-start-column="7" selection-end-line="34" selection-end-column="7" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
......
......@@ -7,7 +7,7 @@ import pandas as pd
import traceback
from log_settings import *
import logging
from auto_request import login, reply, click, get_comment, time_conv
from auto_request import login, reply, click, get_comments, time_conv
from auto_request import host, user, port, db, passwd
......@@ -127,6 +127,7 @@ from auto_request import host, user, port, db, passwd
# except:
#
# return None
# 9,12,18,2
def get_topic_id(numtime):
......@@ -156,11 +157,14 @@ if __name__ == "__main__":
click_num = random.randint(1, 3)
for i in range(click_num):
for j in topic_id:
id = int(j[0])
cookies = login()
time.sleep(random.randint(1, 10))
time.sleep(random.randint(10, 20))
click(cookies, id)
......@@ -168,7 +172,9 @@ if __name__ == "__main__":
topic_id = get_topic_id(numtime)
comment_num = random.randint(1, 3)
comment_num = random.randint(0, 3)
comment_content = get_comments()
for i in range(comment_num):
......@@ -179,8 +185,10 @@ if __name__ == "__main__":
cookies = login()
if cookies is not None:
comment = get_comment()
time.sleep(random.randint(1, 10))
comment = comment_content[i]
time.sleep(random.randint(10,20))
reply(cookies, id, comment)
......
......@@ -131,7 +131,9 @@ if __name__ == "__main__":
else:
dicts[i[0]].append(i[1])
print(dicts)
for key, value in dicts.items():
rand_num = random.randint(0, len(value) - 1)
......
......@@ -151,6 +151,7 @@ if __name__ == "__main__":
cook = login()
if cook is not None:
click(cook, rand_id)
except:
......
......@@ -134,33 +134,17 @@ if __name__ == "__main__":
topic_id = get_topic_id(numtime)
dicts = {}
for i in topic_id:
if i[0] not in dicts.keys():
dicts.setdefault(i[0], [])
dicts[i[0]].append(i[1])
else:
dicts[i[0]].append(i[1])
for key, value in dicts.items():
rand_num = random.randint(0, len(value) - 1)
comment = get_comment()
rand_id = value[rand_num]
for id in topic_id:
time.sleep(random.randint(1, 10))
cook = login()
if cook is not None:
comment = get_comment()
reply(cook, rand_id, comment)
reply(cook, id, comment)
except:
......
......@@ -29,10 +29,11 @@ auto_urge_url = "http://earth.igengmei.com/api/v1/user/urge"
# port = 3306
host = "rm-2zeaut61u9sm21m0b.mysql.rds.aliyuncs.com"
user = 'work'
passwd = 'Gengmei123'
user = "work"
passwd = "Gengmei123"
db = "alpha"
port = '3306'
port ="3306"
def get_majia():
try:
......@@ -147,7 +148,9 @@ def get_comment():
list_guanshui = []
for i in data:
list_guanshui.append(i)
num = random.randint(0, len(list_guanshui))
comment = list_guanshui[num - 1]
return comment
......@@ -157,6 +160,32 @@ def get_comment():
return None
def get_comments():
try:
data = open("/srv/apps/cybertron/guanshui", "r")
list_guanshui = []
for i in data:
list_guanshui.append(i)
num1 = random.randint(0, 50)
num2 = random.randint(50, 70)
num3 = random.randint(70, len(list_guanshui))
comment1 = list_guanshui[num1 - 1]
comment2 = list_guanshui[num2 - 1]
comment3 = list_guanshui[num3 - 1]
comment_list = [comment1,comment2,comment3]
return comment_list
except:
return None
def follow(cookies_get, id):
try:
post_dict = {
......@@ -188,3 +217,43 @@ def Urge(cookies_get, id):
except:
logging.error("catch exception,logins:%s" % traceback.format_exc())
def get_offline_comment():
try:
data = open("/srv/apps/cybertron/offline_comment.txt", "r")
list_guanshui = []
for i in data:
list_guanshui.append(i)
num1 = random.randint(0, 500)
num2 = random.randint(500, 1000)
num3 = random.randint(1000, 1500)
num4 = random.randint(1500, len(list_guanshui))
comment1 = list_guanshui[num1 - 1]
comment2 = list_guanshui[num2 - 1]
comment3 = list_guanshui[num3 - 1]
comment4 = list_guanshui[num4 - 1]
comment_list = [comment1, comment2, comment3, comment4]
return comment_list
except:
return None
def logins():
try:
user_id = get_majia()
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
import requests
import time
import datetime
import pymysql
import random
import pandas as pd
import traceback
from log_settings import *
import logging
from auto_request import host, user, port, db, passwd
def get_data():
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port)
cursor = pc.cursor()
cursor.execute("select user_id from user_extra where is_shadow = 0")
data = cursor.fetchall()
user_id = list(data)
pc.close()
return user_id
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return None
data = get_data(time)
file = open("user_id.txt")
for i in data:
file.write(i)
import requests
import time
import datetime
import pymysql
import random
import pandas as pd
import traceback
from log_settings import *
import logging
from auto_request import logins, reply, get_offline_comment, time_convs
# from auto_request import host, user, port, db, passwd
auto_click_url = "http://earth.igengmei.com/api/v1/like"
auto_reply_url = "http://earth.igengmei.com/api/v1/reply/create"
auto_follow_url = "http://earth.igengmei.com/api/v1/follow"
auto_urge_url = "http://earth.igengmei.com/api/v1/user/urge"
# 对所有马甲生产的帖子(包含历史帖子)
#
# 离线一次性插入{0,4}条评论
#
# 评论取自评论库,并自动随机关联马甲
#
# 注意需要禁止本帖作者评论
host = "rm-2zeaut61u9sm21m0b.mysql.rds.aliyuncs.com"
user = "work"
passwd = "Gengmei123"
db = "alpha"
port ="3306"
def get_data(numtime):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port)
cursor = pc.cursor()
cursor.execute(
"SELECT id FROM topic WHERE is_online =1 and create_time >= %s and (content_level = 4 or content_level = 5) and user_id in (select user_id from user_extra where is_shadow = 0)",
(numtime))
data = cursor.fetchall()
user_id = list(data)
logging.info("Database version : %s " % user_id)
pc.close()
return user_id
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return None
if __name__ == "__main__":
try:
time_list = [1, 2, 3, 4, 5, 6, 7]
for i in time_list:
numtime = time_convs(i)
topic_id = get_data(numtime)
dicts = {}
rand_num = random.randint(0, 4)
for id in topic_id:
comment_list = get_offline_comment()
for i in rand_num:
cook =logins()
comment = get_offline_comment()
comment = comment_list[rand_num]
reply(cook, id, comment)
except:
logging.error("catch exception,main :%s" % traceback.format_exc())
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