From da5080c53ce8e9e520187e19eeb907c46607b4f0 Mon Sep 17 00:00:00 2001 From: epoch Date: Tue, 1 Feb 2022 03:21:34 +0000 Subject: wikipedia search handler added and normal handler updated --- contrib/wikipedia-search-handler | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 contrib/wikipedia-search-handler (limited to 'contrib/wikipedia-search-handler') diff --git a/contrib/wikipedia-search-handler b/contrib/wikipedia-search-handler new file mode 100755 index 0000000..72f051f --- /dev/null +++ b/contrib/wikipedia-search-handler @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +uri="$1" +shortened="$(unshorten.sh "${uri}")" +if [ "${shortened}" ];then + uri="${shortened}" +fi +shortened="$(unshorten.sh "${uri}")" +if [ "${shortened}" ];then + uri="${shortened}" + uristart "$uri" +else + curl -g "$uri" | grep '^The page "