Move towards grabtitle strategy for imdb title. - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit c4b73693b2ab8fbd5982798638e4083848a3cce0 DIR parent 0925485876164dc16cd6dd149ec600ba690b117a HTML Author: Annna Robert-Houdin <annna@bitreich.org> Date: Sun, 5 Dec 2021 20:02:20 +0100 Move towards grabtitle strategy for imdb title. Diffstat: M imdb2gopherbay | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --- DIR diff --git a/imdb2gopherbay b/imdb2gopherbay @@ -1,11 +1,14 @@ #!/bin/sh +export PATH="/home/annna/bin:$PATH" + if [ $# -lt 1 ]; then printf "usage: %s imdburi\n" "$(basename "$0")" >&2 exit 1 fi +# TODO: See, if this is needed eventually, if title changes. extractjson() { awk ' /<script id="__NEXT_DATA__"/ { @@ -19,11 +22,14 @@ awk ' imdburi="$1" title="$(curl -s "${imdburi}" \ - | extractjson \ - | json2tsv \ - | grep associatedTitle.originalTitleText.text \ - | head -n 1 \ - | cut -f 3)" + | grabtitle \ + | sed 's, - IMDb,,')" + +# | extractjson \ +# | json2tsv \ +# | grep associatedTitle.originalTitleText.text )" +# | head -n 1 \ +# | cut -f 3)" [ -z "${title}" ] && exit 1