marvvin

IRC bot
Log | Files | Refs | README | LICENSE

commit 6d252d06dbb034768f791207f4fdb403265ad263
parent 67f0823fed70d95f1f206351754e2fabaa1a90bb
Author: hhvn <dev@hhvn.uk>
Date:   Mon, 28 Feb 2022 22:20:24 +0000

Forgot to use correct IFS.

Diffstat:
Mhandler.rc | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/handler.rc b/handler.rc @@ -80,17 +80,17 @@ fn title { curl -qsLD - $url | tr -d '\r' | sed '/^[^[:print:]]*$/q' | tr '[:upper:]' '[:lower:]' > data/headers curl -qsL $url | tr -d '\r' > data/content if (echo $url | grep 'http[s]*://[w.]*youtu[.]*be' >/dev/null) { - title = `{< data/content \ + title = `$nl{< data/content \ grep '\[{\"videoPrimaryInfoRenderer\":{\"title\":{\"runs\"\:\[{\"text\":' | sed 's/.*\[{\"videoPrimaryInfoRenderer\":{\"title\":{\"runs\"\:\[{\"text\":// ; s/}\]}.*// ; s/\\//g ; s/^\"// ; s/.$//'} - author = `{< data/content \ + author = `$nl{< data/content \ grep -o 'author":[^}]*}' | sed -E 's/.*:"([^"]*).*/\1/g'} - date = `{< data/content \ + date = `$nl{< data/content \ grep -o 'uploadDate":[^}]*}' | sed -E 's/.*:"([^"]*).*/\1/g;s/([0-9]*)-([0-9]*)-([0-9]*)/\3-\2-\1/'} - send_notice $TARGET '05You05,16Tube ::: Title: ' ^ $title ^ ' ::: Author: ' ^ $author ^ ' ::: Uploaded: ' ^ $date + send_notice $TARGET `$nl{printf '40You91,16Tube ::: Title: %s ::: Author: %s ::: Uploaded: %s\n' $title $author $date} } else { code = `{head -n 1 < data/headers} ctype = `{awk -F: '$1 == "content-type" {print $2}' < data/headers}