Created
December 17, 2014 21:22
-
-
Save Sadin/1970b15cef6616fd7196 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import render_template | |
from mcstatus import MinecraftServer | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template("index.html") | |
@app.route('/mc/<arg1>') | |
def mc(arg1): | |
server = MinecraftServer.lookup(arg1) | |
status = server.status() | |
latency = server.ping() | |
query = server.query() | |
return "The server has {0} players and responded to the request in {1} ms | The server response time is {2} ms ".format(status.players.online, status.latency, latency) | |
if __name__ == '__main__': | |
app.run(host="0.0.0.0", port=int("80"), debug=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "layout.html" %} | |
{% block title %}SoT{% endblock %} | |
{% block content %} | |
<h1> Sages of Twilight</h1> | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>{% block title %}{% endblock %}</title> | |
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" /> | |
</head> | |
<body> | |
{% block content %}{% endblock %} | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>SoT</title> | |
<link rel="stylesheet" href="/static/css/style.css" /> | |
</head> | |
<body> | |
<h1> Sages of Twilight</h1> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment