From 41eff809a0a83a80d76c2beb7a1c39c555dc5345 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 24 Jul 2022 13:04:26 -0500 Subject: Un-paywall sites Ideally there'd be a file that would list the sites I want to unpaywall. --- sfeed_html.awk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sfeed_html.awk b/sfeed_html.awk index cd45c7b..0d620b8 100755 --- a/sfeed_html.awk +++ b/sfeed_html.awk @@ -61,6 +61,10 @@ BEGIN { if (! REDDIT_ALT_URL) { REDDIT_ALT_URL = envor("SFEED_REDDIT_ALT_URL", "https://libreddit.spike.codes") } + # Paywalls + PAYWALL_LADDER = "https://archive.ph/newest/" + PAYWALLED[1] = "washingtonpost\\.com" + PAYWALLED[2] = "nytimes\\.com" # Awk and convenience constants FS = "\t" STDERR = "/dev/stderr" @@ -327,6 +331,13 @@ function silo_link(link) sub(http "twitter\\.com", TWITTER_ALT_URL, ret) } else { siloed = 0 + for (site in PAYWALLED) { + if (link ~ (http PAYWALLED[site])) { + ret = PAYWALL_LADDER link + siloed = 1 + break + } + } } return ret } -- cgit 1.4.1-21-gabe81