From 038cab1e8ca4e465e44263772646da920d5038ff Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 2 Aug 2022 15:16:10 -0500 Subject: Fix link issue --- sfeedrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sfeedrc b/sfeedrc index 313876e..b09c20b 100644 --- a/sfeedrc +++ b/sfeedrc @@ -290,9 +290,9 @@ print # Reddit doesn't include a link as its item IDs, but instead # something of the form `t3_xxxxx', where xxxxx can be glommed # into a URL to get to the comments. - awk -v SUBREDDIT="$1" -v ALT=i.reddit.com \ - 'BEGIN { FS="\t"; OFS="\t"; } - { $6 = $3 ALT "/" SUBREDDIT "/" substr($6, 4); } + gawk -v SUBREDDIT="$1" -v ALT=i.reddit.com \ + 'BEGIN { FS="\t"; OFS="\t"; sub("^r_","r/",SUBREDDIT); } + { $6 = "https://" ALT "/" SUBREDDIT "/" substr($6, 4); } { if (match($4,/\[link\]<\/a>/,ln)) $3 = ln[1]; } { gsub(/www\.reddit\.com/, ALT, $0); } { print; }' -- cgit 1.4.1-21-gabe81