aboutsummaryrefslogtreecommitdiff
path: root/cgi/weather
diff options
context:
space:
mode:
authorsn4il <sn4il@theplace>2023-06-27 10:59:14 +0300
committersn4il <sn4il@theplace>2023-06-27 10:59:14 +0300
commit91406f02b2a87e0dbfaf8a391edd049c25563848 (patch)
treeb06afb9bbc7e7c5e9aa74def727bdbb52bf8c365 /cgi/weather
downloadpubnix-91406f02b2a87e0dbfaf8a391edd049c25563848.tar.gz
pubnix-91406f02b2a87e0dbfaf8a391edd049c25563848.zip
Initial commit
Diffstat (limited to 'cgi/weather')
-rwxr-xr-xcgi/weather24
1 files changed, 24 insertions, 0 deletions
diff --git a/cgi/weather b/cgi/weather
new file mode 100755
index 0000000..5590e83
--- /dev/null
+++ b/cgi/weather
@@ -0,0 +1,24 @@
+#!/usr/bin/python3
+
+import os
+import subprocess
+import sys
+import urllib.parse
+
+import datetime
+from datetime import date
+
+query = os.environ["QUERY_STRING"]
+if not query:
+ print("10 Введите поисковый запрос и нажмите \"Enter\".")
+ sys.exit()
+
+text = urllib.parse.unquote(query)
+
+print("20 text/gemini")
+
+#print("````")
+#print (text)
+
+print(subprocess.Popen(["ansiweather", "-F", "-u", "metric", "-a", "false", "-w", "true", "-p", "true", "-d", "true", "-s", "false", "-l" , text ], stdout=subprocess.PIPE).stdout.read())
+#print("````")