From cfd882717f1e13c294e2d481a46ca8982c97f05c Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Sun, 1 Nov 2020 18:47:04 -0600 Subject: new file: color_test.py modified: post_bot.py new file: test_page --- color_test.py | 15 + post_bot.py | 95 +- test_page | 3789 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 3868 insertions(+), 31 deletions(-) create mode 100755 color_test.py create mode 100644 test_page diff --git a/color_test.py b/color_test.py new file mode 100755 index 0000000..288707a --- /dev/null +++ b/color_test.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +color = 0x0000ff +def rainbow_gen(color): + if (color & 0x0000ff == 0xff) and (color ^ 0xff0000 == 0xff) and (color ^ 0x00ff00 < 0xff): + color += 0x100 + color -= 1 + print("test") + + return color + +while True: + color = rainbow_gen(color) + print(hex(color)) + diff --git a/post_bot.py b/post_bot.py index aa9a49d..28e07e5 100755 --- a/post_bot.py +++ b/post_bot.py @@ -1,7 +1,10 @@ #!/usr/bin/env python3 import requests +import re from time import sleep +from datetime import datetime, timezone from os import fork +from threading import Timer post_cooloff = 7 @@ -18,35 +21,65 @@ if not rp.json()['account_id']: rp = rs.get('https://recolor.me/') key_pos = rp.text.find("site.my_key = \'") + len("site.my_key = ") -key = rp.text[key_pos:key_pos+32] - - -rs.post('https://recolor.me/topic/1557621', data={ - 'key':key, - 'page':'topic', - 'action':'reply', - 'topic_id':'1557621', - 'reply_message':'posts with 7 second delay (pair 2)', - 'box_color':'#ff0000', - 'post_color':'#0', - 'post_style':'0' - }) -rs.post('https://recolor.me/topic/1557621', data={ - 'key':key, - 'page':'topic', - 'action':'reply', - 'topic_id':'1557621', - 'reply_message':'posts with 7 second delay (pair 2)', - 'box_color':'#0000ff', - 'post_color':'#0', - 'post_style':'0' - }) - - - - #while True: - #treats += 1 - #print("Trick or treats: {}".format(treats)) - #print("Money accumulated: {}".format(treats * 10)) -#cfc4cfa627a259e8d810849680c0460aeb369b93f3d40bd17ab7401031419b43ffebf8e79cb655a3eaeff675427ad6832b2d0eb8813d0844ddef7f9166d0470d +#key = rp.text[key_pos:key_pos+32] +key = re.search("site.my_key = \'(.*)\';", rp.text).groups()[0] + + +def acheive_limit(): + uncaped = True + check_space = 20 + on_post = check_space + + while uncaped: + print("starting again!!!!") + sleep(7) + on_post += 1 + + if on_post > check_space: + on_post = 0 + rp = rs.get('https://recolor.me/account') + bits = re.search("site.my_bits = (\d*);", rp.text).groups()[0] + bit_limit = re.search("site.limit_bits = (\d*);", rp.text).groups()[0] + daily_limit = re.search("site.daily_limit = (\d*);", rp.text).groups()[0] + limit_percentage = int((int(daily_limit) / int(bit_limit)) * 100) + print("total bits: {}\nbit cap: {}/{}\t\t{}%".format(bits, daily_limit, bit_limit, limit_percentage)) + + if daily_limit == bit_limit: + uncaped = False + rs.post('https://recolor.me/topic/1557621', data={ + 'key':key, + 'page':'topic', + 'action':'reply', + 'topic_id':'1557621', + 'reply_message':"Done for today!\nSleeping until 04:00 UTC.".format("04:00"), + 'box_color':'#0000ff', + 'post_color':'#0', + 'post_style':'0' + }) + + rs.post('https://recolor.me/topic/1557621', data={ + 'key':key, + 'page':'topic', + 'action':'reply', + 'topic_id':'1557621', + 'reply_message':"Daily quota: {}/{}\t{}%\nLast checked {} messages ago\nNext check is {} messages from now".format(daily_limit, bit_limit, limit_percentage, on_post, check_space - on_post), + 'box_color':'#0000ff', + 'post_color':'#0', + 'post_style':'0' + }) + +acheive_limit() + +while True: + current_time = datetime.now(timezone.utc) + desired_time = current_time.replace(day=current_time.day+1, hour=4, minute=0, second=0, microsecond=0) + print("starting next run at {}".format(str(desired_time))) + cap_thread = Timer((desired_time - current_time).seconds+1, acheive_limit) + cap_thread.start() + cap_thread.join() + + +#usually resets at 11 + + diff --git a/test_page b/test_page new file mode 100644 index 0000000..709cc21 --- /dev/null +++ b/test_page @@ -0,0 +1,3789 @@ +HTTP/1.1 200 OK + +Date: Mon, 02 Nov 2020 03:36:31 GMT + +Content-Type: text/html; charset=UTF-8 + +Connection: close + +X-Powered-By: PHP/7.0.33 + +Expires: Thu, 19 Nov 1981 08:52:00 GMT + +Cache-Control: no-store, no-cache, must-revalidate + +Pragma: no-cache + +Pragma: public + +CF-Cache-Status: DYNAMIC + +cf-request-id: 0628a033320000eca628294000000001 + +Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + +Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=I%2FnM1I7XsNBQajStTTluEJdN2ScNg%2BU%2FGukz0JCSp71g4yJ4KFfO%2F9pOAeC843pdrXWU0LeNeB8c4YsZ%2FexKgqfL1hTL3G85LJL7"}],"group":"cf-nel","max_age":604800} + +NEL: {"report_to":"cf-nel","max_age":604800} + +Server: cloudflare + +CF-RAY: 5ebacfcb8c96eca6-DFW + +Content-Length: 229284 + + + + + + +Account Settings < recolor.me + + + + + + + + + + + + + + + + + + + +

recolor.me

+ +
+ + +
+ +
+
+ + + + + + + +
Loading...
+ + -- cgit v1.2.3