aboutsummaryrefslogtreecommitdiff
path: root/cgi/weather
diff options
context:
space:
mode:
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("````")