Taka005
commited on
Commit
·
96fe673
1
Parent(s):
ab969e9
変更
Browse files
README.md
CHANGED
|
@@ -4,14 +4,15 @@
|
|
| 4 |
- `python main.py`で起動
|
| 5 |
- `http://localhost:3000/`でアクセスする
|
| 6 |
## エンドポイント
|
| 7 |
-
-
|
| 8 |
-
- `/colour` カラーアイコン
|
| 9 |
-
- `/reverse` アイコンの位置反転
|
| 10 |
-
- `/reverseColor` カラーアイコン・アイコンの位置反転
|
| 11 |
-
- `/white` 色反転
|
| 12 |
-
- `/reverseWhite` 色反転・アイコンの位置反転
|
| 13 |
## パラメーター
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
- name: 名前
|
| 15 |
- id: ID
|
| 16 |
- content: 内容
|
| 17 |
-
- icon: アイコン
|
|
|
|
| 4 |
- `python main.py`で起動
|
| 5 |
- `http://localhost:3000/`でアクセスする
|
| 6 |
## エンドポイント
|
| 7 |
+
- `/`で生成
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
## パラメーター
|
| 9 |
+
- type: タイプ
|
| 10 |
+
- - `colour` カラーアイコン
|
| 11 |
+
- - `reverse` アイコンの位置反転
|
| 12 |
+
- - `reverseColor` カラーアイコン・アイコンの位置反転
|
| 13 |
+
- - `white` 色反転
|
| 14 |
+
- - `reverseWhite` 色反転・アイコンの位置反転
|
| 15 |
- name: 名前
|
| 16 |
- id: ID
|
| 17 |
- content: 内容
|
| 18 |
+
- icon: アイコン(URL)
|
main.py
CHANGED
|
@@ -244,65 +244,27 @@ app = Flask(__name__)
|
|
| 244 |
|
| 245 |
@app.route("/", methods=["GET"])
|
| 246 |
def main():
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
def reverse():
|
| 267 |
-
res = reverseMake(
|
| 268 |
-
request.args.get("name") or "SAMPLE",
|
| 269 |
-
request.args.get("id") or "0000000000000000000",
|
| 270 |
-
request.args.get("content") or "Make it a Quote",
|
| 271 |
-
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
| 272 |
-
)
|
| 273 |
-
return send_file(res, mimetype="image/png")
|
| 274 |
-
|
| 275 |
-
@app.route("/reverseColor", methods=["GET"])
|
| 276 |
-
def reverseColor():
|
| 277 |
-
res = reverseColorMake(
|
| 278 |
-
request.args.get("name") or "SAMPLE",
|
| 279 |
-
request.args.get("id") or "0000000000000000000",
|
| 280 |
-
request.args.get("content") or "Make it a Quote",
|
| 281 |
-
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
| 282 |
-
)
|
| 283 |
-
return send_file(res, mimetype="image/png")
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
@app.route("/white", methods=["GET"])
|
| 287 |
-
def white():
|
| 288 |
-
res = whiteMake(
|
| 289 |
-
request.args.get("name") or "SAMPLE",
|
| 290 |
-
request.args.get("id") or "0000000000000000000",
|
| 291 |
-
request.args.get("content") or "Make it a Quote",
|
| 292 |
-
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
| 293 |
-
)
|
| 294 |
-
return send_file(res, mimetype="image/png")
|
| 295 |
|
| 296 |
-
@app.route("/reverseWhite", methods=["GET"])
|
| 297 |
-
def reverseWhite():
|
| 298 |
-
res = reverseWhiteMake(
|
| 299 |
-
request.args.get("name") or "SAMPLE",
|
| 300 |
-
request.args.get("id") or "0000000000000000000",
|
| 301 |
-
request.args.get("content") or "Make it a Quote",
|
| 302 |
-
request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
| 303 |
-
)
|
| 304 |
return send_file(res, mimetype="image/png")
|
| 305 |
|
| 306 |
-
|
| 307 |
if __name__ == "__main__":
|
| 308 |
-
app.run(host="0.0.0.0", port=3000)
|
|
|
|
| 244 |
|
| 245 |
@app.route("/", methods=["GET"])
|
| 246 |
def main():
|
| 247 |
+
type = request.args.get("type")
|
| 248 |
+
name = request.args.get("name") or "SAMPLE",
|
| 249 |
+
id = request.args.get("id") or "0000000000000000000",
|
| 250 |
+
content = request.args.get("content") or "Make it a Quote",
|
| 251 |
+
icon = request.args.get("icon") or "https://cdn.discordapp.com/embed/avatars/0.png"
|
| 252 |
+
|
| 253 |
+
res
|
| 254 |
+
if type == "color":
|
| 255 |
+
res = colorMake(name, id, content, icon)
|
| 256 |
+
elif type == "reverse":
|
| 257 |
+
res = reverseMake(name, id, content, icon)
|
| 258 |
+
elif type == "reverseColor":
|
| 259 |
+
res = reverseColorMake(name, id, content, icon)
|
| 260 |
+
elif type == "white":
|
| 261 |
+
res = whiteMake(name, id, content, icon)
|
| 262 |
+
elif type == "reverseWhite":
|
| 263 |
+
res = reverseWhiteMake(name, id, content, icon)
|
| 264 |
+
else:
|
| 265 |
+
res = make(name, id, content, icon)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
return send_file(res, mimetype="image/png")
|
| 268 |
|
|
|
|
| 269 |
if __name__ == "__main__":
|
| 270 |
+
app.run(host="0.0.0.0", port=3000)
|