mirror of
https://github.com/LucasVbr/LucasVbr.git
synced 2026-07-09 14:27:46 +00:00
Add random Quote
This commit is contained in:
@@ -3,6 +3,12 @@
|
|||||||
# Hi <img src="https://raw.githubusercontent.com/iampavangandhi/iampavangandhi/master/gifs/Hi.gif" alt="👋" width="50px"/>, I'm LucasVbr
|
# Hi <img src="https://raw.githubusercontent.com/iampavangandhi/iampavangandhi/master/gifs/Hi.gif" alt="👋" width="50px"/>, I'm LucasVbr
|
||||||
### A passionate developer from France
|
### A passionate developer from France
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
"*Talent is God-given; be humble. Fame is man-given; be thankful. Conceit is self-given; be careful.*"
|
||||||
|
|
||||||
|
by Harvey Mackay
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Badges -->
|
<!-- Badges -->
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ __author__ = "LucasVbr"
|
|||||||
__version__ = "3.0.0"
|
__version__ = "3.0.0"
|
||||||
|
|
||||||
from flask import render_template
|
from flask import render_template
|
||||||
|
import requests
|
||||||
import flask
|
import flask
|
||||||
import json
|
import json
|
||||||
|
|
||||||
@@ -18,9 +19,12 @@ if __name__ == "__main__":
|
|||||||
with open(DATA_FILE) as file:
|
with open(DATA_FILE) as file:
|
||||||
data = json.load(file)
|
data = json.load(file)
|
||||||
|
|
||||||
|
# Get random quote
|
||||||
|
quote = requests.get("https://api.quotable.io/random")
|
||||||
|
|
||||||
# Build from template and data
|
# Build from template and data
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
rendered = render_template(TEMPLATE_FILE, data=data)
|
rendered = render_template(TEMPLATE_FILE, data=data, quote=quote.json())
|
||||||
|
|
||||||
# Generate Markdown file
|
# Generate Markdown file
|
||||||
with open(OUTPUT_FILE, "w", encoding="utf8") as file:
|
with open(OUTPUT_FILE, "w", encoding="utf8") as file:
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
flask
|
flask
|
||||||
json
|
json
|
||||||
|
requests
|
||||||
@@ -3,4 +3,10 @@
|
|||||||
# Hi {{ img(data.hi.src, data.hi.alt, data.hi.width) }}, I'm LucasVbr
|
# Hi {{ img(data.hi.src, data.hi.alt, data.hi.width) }}, I'm LucasVbr
|
||||||
### A passionate developer from France
|
### A passionate developer from France
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
"*{{ quote.content }}*"
|
||||||
|
|
||||||
|
by {{ quote.author }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user