diff options
author | Case Duckworth | 2022-08-02 15:16:10 -0500 |
---|---|---|
committer | Case Duckworth | 2022-08-02 15:16:10 -0500 |
commit | 038cab1e8ca4e465e44263772646da920d5038ff (patch) | |
tree | b52f312ab6a65aa9bd458b6f3986b4049c464cfb /sfeedrc | |
parent | Add subscription and remove a few (diff) | |
download | sfeed-038cab1e8ca4e465e44263772646da920d5038ff.tar.gz sfeed-038cab1e8ca4e465e44263772646da920d5038ff.zip |
Fix link issue
Diffstat (limited to 'sfeedrc')
-rw-r--r-- | sfeedrc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sfeedrc b/sfeedrc index 313876e..b09c20b 100644 --- a/sfeedrc +++ b/sfeedrc | |||
@@ -290,9 +290,9 @@ print | |||
290 | # Reddit doesn't include a link as its item IDs, but instead | 290 | # Reddit doesn't include a link as its item IDs, but instead |
291 | # something of the form `t3_xxxxx', where xxxxx can be glommed | 291 | # something of the form `t3_xxxxx', where xxxxx can be glommed |
292 | # into a URL to get to the comments. | 292 | # into a URL to get to the comments. |
293 | awk -v SUBREDDIT="$1" -v ALT=i.reddit.com \ | 293 | gawk -v SUBREDDIT="$1" -v ALT=i.reddit.com \ |
294 | 'BEGIN { FS="\t"; OFS="\t"; } | 294 | 'BEGIN { FS="\t"; OFS="\t"; sub("^r_","r/",SUBREDDIT); } |
295 | { $6 = $3 ALT "/" SUBREDDIT "/" substr($6, 4); } | 295 | { $6 = "https://" ALT "/" SUBREDDIT "/" substr($6, 4); } |
296 | { if (match($4,/<a href="([^"]*)">\[link\]<\/a>/,ln)) $3 = ln[1]; } | 296 | { if (match($4,/<a href="([^"]*)">\[link\]<\/a>/,ln)) $3 = ln[1]; } |
297 | { gsub(/www\.reddit\.com/, ALT, $0); } | 297 | { gsub(/www\.reddit\.com/, ALT, $0); } |
298 | { print; }' | 298 | { print; }' |