-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhello.py
More file actions
87 lines (83 loc) · 2.44 KB
/
Copy pathhello.py
File metadata and controls
87 lines (83 loc) · 2.44 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
from __future__ import print_function
from flask import Flask
from flask import render_template
import requests
from flask import request
import json
from shopifytask import shopifytask
import glob, os
app = Flask(__name__)
stasks=[]
@app.route('/')
def hello():
return render_template("blank_page.html")
@app.route('/creator')
def load():
return render_template('blank_page.html')
@app.route('/', methods=['POST'])
def check_key():
print(request.form)
print(request.form['key'])
data ={
'key':request.form['key']
}
r = requests.post("http://www.redmond2828.club/check_auth", data=data)
print(r.text)
if(r.text == "true"):
print("hi")
return render_template('blank_page.html')
return render_template('activation.html')
@app.route('/check_auth',methods=['POST'])
def checkKey():
print(request.form)
key = request.form["key"]
f = open("keys.txt","r")
lines = f.readlines()
key = key+"\n"
f.close()
f = open("keys.txt","w")
a = open("activated.txt","a+")
print(key)
for line in lines:
print(line)
if line == key:
print("here")
a.write(key)
return 'true'
else:
f.write(line)
f.close()
a.close()
return 'false'
@app.route('/create_profile', methods=['POST'])
def get_form():
print(request.form)
filePath = "./profiles/"+request.form["profile"]+".json"
p = open(filePath, 'w+')
json.dump(request.form, p)
p.close()
return render_template('blank_page.html')
@app.route('/task_create')
def create():
data = []
for file in glob.glob1(os.getcwd()+"/profiles", "*.json"):
data.append(str(file).split(".")[0])
return render_template('blank_page0.html',data=data)
@app.route('/start_task', methods=['POST'])
def task():
print(request.form)
print( request.form['profile'])
task1 = supremetask.SupremeTask(request.form['profile'])
@app.route('/new_shopify', methods=['POST'])
def add():
print(request.form)
stasks.append(shopifytask(request.form["profile"],request.form["size"],request.form["keywords"],request.form["url"]))
return render_template('task.html',data=stasks)
@app.route('/start_shopping', methods=['POST'])
def start_the_things():
for task in stasks:
task.run()
return render_template('task.html', data=stasks)
if __name__ == "__main__":
print ('oh hello')
app.run(host='127.0.0.1', port=5000)