From 41407e738726b07e3462da59f13299d22ab66fa0 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 21 Aug 2023 03:13:17 +0300 Subject: [PATCH] Add Fate/Samurai Remnant release day counter --- main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.py b/main.py index 56ac2fe..311a3dd 100755 --- a/main.py +++ b/main.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +from datetime import date import json import os import requests as r @@ -76,6 +77,14 @@ def compose_text(data): percent = d['edited'] / float(d['all']) * 100.0 text += '%s: %.2f%% (%d/%d) %s\n' % (k, percent, d['edited'], d['all'], mark) + + days_until_fsr = (date(2023, 9, 29) - date.today()).days + if days_until_fsr > 0: + text += '\n\n%d days until Fate/Samurai Remnant release' % days_until_fsr + elif days_until_fsr == 0: + text += '\n\nFate/Samurai Remnant is going to be released TODAY! 🎉' + elif days_until_fsr > -14: + text += '\n\nFate/Samurai Remnant was released few days ago, did you played it yet?' return text def main():