Skip to content

Commit 1dfe193

Browse files
committed
Nameday addition
1 parent 65c8fcc commit 1dfe193

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Nameday/src/main.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from datetime import date
2+
import requests
3+
import json
4+
5+
def main():
6+
today = date.today().strftime("%Y/%m/%d")
7+
url = f"https://sholiday.faboul.se/dagar/v2.1/{today}"
8+
response = requests.get(url)
9+
response = response.text
10+
data = json.loads(response)
11+
print(data["dagar"][0]["namnsdag"])
12+
13+
if __name__ == "__main__":
14+
main()

0 commit comments

Comments
 (0)