Add support for search - gophercgis - Collection of gopher CGI/DCGI for geomyidae
(HTM) hg clone https://bitbucket.org/iamleot/gophercgis
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) changeset 908c1b46b376039a44d2822e3e45cdc449f52f15
(DIR) parent ccc2fbb8c0375d5c7a90739a58ea2019625814e5
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Sun, 9 Sep 2018 02:10:55
Add support for search
Diffstat:
rep/rep.dcgi | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff -r ccc2fbb8c037 -r 908c1b46b376 rep/rep.dcgi
--- a/rep/rep.dcgi Sun Sep 09 02:04:59 2018 +0200
+++ b/rep/rep.dcgi Sun Sep 09 02:10:55 2018 +0200
@@ -2,11 +2,21 @@
ARTICLE_CGI="/cgi/rep/article.cgi"
+#
+# If an argument is provided use that as search criteria, otherwise just fetch
+# and parse the cover.
+#
+if [ -n "$2" ]; then
+ search="$2"
+ url="https://rep.repubblica.it/ws/search?${search}"
+else
+ url="https://rep.repubblica.it/ws/cover.json"
+fi
+
echo ""
echo "Rep - Repubblica"
echo ""
-url="https://rep.repubblica.it/ws/cover.json"
/usr/bin/ftp -V -o - "${url}" |
/usr/pkg/bin/jq -r '.feed.zones | .[].blocks | .[].entries | .[] |
.title + "\u001c" +