From 8f06d3e3f71550abdf9440cd8526b69f9fb4a0ed Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Tue, 15 Feb 2022 09:45:09 -0500 Subject: [PATCH] fixed get_citation.sh --- scripts/get_citation.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/get_citation.sh b/scripts/get_citation.sh index 74f4b1f..0641df6 100755 --- a/scripts/get_citation.sh +++ b/scripts/get_citation.sh @@ -1,10 +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") -set -x -lynx -dump -nonumbers "$(lynx -dump \ - "$(echo "$first_call" \ - | sed '11q;d' \ - | 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 '^$' +first_call=$(lynx -nonumbers -dump -listonly "https://commons.wikimedia.org/w/index.php?search=${1//_/+}&title=Special:MediaSearch&go=Go&type=image" | sed '11q;d') + +lynx -dump -nonumbers "$(lynx -dump $first_call \ + | awk '/CiteThisPage/ {print $2}')" \ + | grep -A10 'Chicago style' \ + | grep -A10 -e '^$' \ + | grep -B10 'CBE' \ + | grep -B10 -e '^$'