@pieromqwerty/

AutoGram AutoRunner

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6940667736177784","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZnJvbSB0d2lzdGVkLmludGVybmV0IGltcG9ydCB0YXNrLCByZWFjdG9yCmltcG9ydCB3ZWJicm93c2VyCmZyb20gZmxhc2sgaW1wb3J0IEZsYXNrCmZyb20gdGhyZWFkaW5nIGltcG9ydCBUaHJlYWQKCmFwcCA9IEZsYXNrKCcnKQoKQGFwcC5yb3V0ZSgnLycpCmRlZiBob21lKCk6CglyZXR1cm4gIkknbSBhbGl2ZSIKCmRlZiBydW4oKToKCWFwcC5ydW4oaG9zdD0nMC4wLjAuMCcscG9ydD04MDgwKQoKZGVmIGtlZXBfYWxpdmUoKTogIAoJdCA9IFRocmVhZCh0YXJnZXQ9cnVuKQoJdC5zdGFydCgpCgp0aW1lb3V0ID0gMTIwLjAgIyAyIE1pbnV0ZXMKCmRlZiBkb1dvcmsoKToKCXdlYmJyb3dzZXIub3BlbignaHR0cHM6Ly9hdXRvZ3JhbS5waWVyb21xd2VydHkucmVwbC5ydW4vJykKCXByaW50KCdkb2luIGl0JykKCXBhc3MKCmtlZXBfYWxpdmUoKQpsID0gdGFzay5Mb29waW5nQ2FsbChkb1dvcmspCmwuc3RhcnQodGltZW91dCkgIyBjYWxsIGV2ZXJ5IDIgbWludXRlcwpyZWFjdG9yLnJ1bigp"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from twisted.internet import task, reactor
import webbrowser
from flask import Flask
from threading import Thread

app = Flask('')

@app.route('/')
def home():
	return "I'm alive"

def run():
	app.run(host='0.0.0.0',port=8080)

def keep_alive():  
	t = Thread(target=run)
	t.start()

timeout = 120.0 # 2 Minutes

def doWork():
	webbrowser.open('https://autogram.pieromqwerty.repl.run/')
	print('doin it')
	pass

keep_alive()
l = task.LoopingCall(doWork)
l.start(timeout) # call every 2 minutes
reactor.run()