forked from adrianariton/Mohican
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.py
63 lines (50 loc) · 1.27 KB
/
server.py
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
from flask import Flask
from flask import request
from assembler import run_mohican
app = Flask(__name__)
@app.route("/") # ‘https://www.google.com/‘
def home():
return open('index.html')
@app.route("/scrapertest")
def scrapertest():
return open("test_website_page.html")
@app.route("/adver")
def adver():
url = request.args.get('data')
ss = request.args.get('ss')
with open("adver.html", 'w') as f:
f.write("""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="main" style="margin: 50px; width: min-content;">
@@
</div>
</body>
<style>
body, #main {
width: 99%;
height: 100%;
display: flex;
flex-direction: column;
align-content: center;
justify-content: center;
background: white;
}
</style>
</html>"
""")
run_mohican(url, ss)
return open('adver.html')
@app.route("/andu")
def login():
username = request.args.get('a')
password = request.args.get('b')
return f"{username} {password}"
app.run(port=5000)