|
|
@@ -1,6 +1,7 @@
|
|
|
import time
|
|
|
import webhook_listener
|
|
|
import json
|
|
|
+import os
|
|
|
|
|
|
class AutoWebsiteUpdate:
|
|
|
|
|
|
@@ -13,24 +14,29 @@ class AutoWebsiteUpdate:
|
|
|
webhooks.start()
|
|
|
|
|
|
while True:
|
|
|
- print("alive...")
|
|
|
+ #print("alive...")
|
|
|
time.sleep(300)
|
|
|
|
|
|
|
|
|
def process_post_request(self, request, *args, **kwargs):
|
|
|
- stringData = "Received request:\n"
|
|
|
- + "Method: {}\n".format(request.method)
|
|
|
- + "Headers: {}\n".format(request.headers)
|
|
|
- + "Args (url path): {}\n".format(args)
|
|
|
- + "Keyword Args (url parameters): {}\n".format(kwargs)
|
|
|
- + "Body: {}".format(
|
|
|
- request.body.read(int(request.header["Content-Length"]))
|
|
|
- if int(request.headers.get("Content-Length", 0)) > 0
|
|
|
- else""
|
|
|
- )
|
|
|
- writer = open(r'reveived_data.txt','w')
|
|
|
- writer.write(stringData)
|
|
|
- writer.close()
|
|
|
+ #stringData = "Received request:\n"
|
|
|
+ #+ "Method: {}\n".format(request.method)
|
|
|
+ #+ "Headers: {}\n".format(request.headers)
|
|
|
+ #+ "Args (url path): {}\n".format(args)
|
|
|
+ #+ "Keyword Args (url parameters): {}\n".format(kwargs)
|
|
|
+ #+ "Body: {}"#.format(
|
|
|
+ #request.body.read(int(request.header["Content-Length"]))
|
|
|
+ #if int(request.headers.get("Content-Length", 0)) > 0
|
|
|
+ #else""
|
|
|
+ ##)
|
|
|
+ #stringData = "asdf"
|
|
|
+ #writer = open(r'reveived_data.txt','w')
|
|
|
+ #writer.write(stringData)
|
|
|
+ #writer.close()
|
|
|
+
|
|
|
+ cmd_command = './download_extract_move.sh'
|
|
|
+ os.system(cmd_command)
|
|
|
+
|
|
|
return "received"
|
|
|
|
|
|
|