From ba5ad4d53ac50f60eb01c3c821540c19f50803c1 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Tue, 15 Feb 2022 09:18:22 -0500 Subject: [PATCH] handles apostrophy --- scripts/get_citation.sh | 11 ++++++----- scripts/stats.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/get_citation.sh b/scripts/get_citation.sh index 5452d62..74f4b1f 100755 --- a/scripts/get_citation.sh +++ b/scripts/get_citation.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash # testing getting images dynamically first_call=$(lynx -dump -listonly "https://commons.wikimedia.org/w/index.php?search=${1//_/+}&title=Special:MediaSearch&go=Go&type=image") -lynx -dump -nonumbers $(lynx -dump \ - $(echo "$first_call" \ +set -x +lynx -dump -nonumbers "$(lynx -dump \ + "$(echo "$first_call" \ | sed '11q;d' \ - | awk '{print $2}' ) \ - | awk -F'. ' '/Cite/ {print $2}' \ - | xargs echo -n) 2>&1 | grep -A10 'Chicago style' | grep -A10 -e '^$' | grep -B10 'CBE' | grep -B10 -e '^$' + | awk '{print $2}' )" \ + | awk -F'. ' '/Cite/ {print $3}' \ + | xargs echo -n)" 2>&1 | grep -A10 'Chicago style' | grep -A10 -e '^$' | grep -B10 'CBE' | grep -B10 -e '^$' diff --git a/scripts/stats.php b/scripts/stats.php index 01bcfc2..32c8117 100644 --- a/scripts/stats.php +++ b/scripts/stats.php @@ -216,7 +216,7 @@ while($rows=$stats ->fetch_assoc()) fetch_assoc()) { ?> - " + "