import time import os import webhook_listener def process_post_request(request, *args, **kwargs): print( "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.headers["Content-Length"])) # if int(request.headers.get("Content-Length", 0)) > 0 # else "" # ) ) # Process request here os.system('git pull') os.system('cd ../slides; ./build.sh once') return webhooks = webhook_listener.Listener(handlers={"POST": process_post_request},logScreen=False) webhooks.start() while True: print("Still alive....") time.sleep(300)