diff options
author | Case Duckworth | 2022-07-24 13:04:26 -0500 |
---|---|---|
committer | Case Duckworth | 2022-07-24 13:04:45 -0500 |
commit | 41eff809a0a83a80d76c2beb7a1c39c555dc5345 (patch) | |
tree | f2e87e9cc1e8dbe866ba01c15c257925b27a71f4 | |
parent | Fix fresh/stale styling (diff) | |
download | sfeed-41eff809a0a83a80d76c2beb7a1c39c555dc5345.tar.gz sfeed-41eff809a0a83a80d76c2beb7a1c39c555dc5345.zip |
Un-paywall sites
Ideally there'd be a file that would list the sites I want to unpaywall.
-rwxr-xr-x | sfeed_html.awk | 11 |
1 files changed, 11 insertions, 0 deletions
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 { | |||
61 | if (! REDDIT_ALT_URL) { | 61 | if (! REDDIT_ALT_URL) { |
62 | REDDIT_ALT_URL = envor("SFEED_REDDIT_ALT_URL", "https://libreddit.spike.codes") | 62 | REDDIT_ALT_URL = envor("SFEED_REDDIT_ALT_URL", "https://libreddit.spike.codes") |
63 | } | 63 | } |
64 | # Paywalls | ||
65 | PAYWALL_LADDER = "https://archive.ph/newest/" | ||
66 | PAYWALLED[1] = "washingtonpost\\.com" | ||
67 | PAYWALLED[2] = "nytimes\\.com" | ||
64 | # Awk and convenience constants | 68 | # Awk and convenience constants |
65 | FS = "\t" | 69 | FS = "\t" |
66 | STDERR = "/dev/stderr" | 70 | STDERR = "/dev/stderr" |
@@ -327,6 +331,13 @@ function silo_link(link) | |||
327 | sub(http "twitter\\.com", TWITTER_ALT_URL, ret) | 331 | sub(http "twitter\\.com", TWITTER_ALT_URL, ret) |
328 | } else { | 332 | } else { |
329 | siloed = 0 | 333 | siloed = 0 |
334 | for (site in PAYWALLED) { | ||
335 | if (link ~ (http PAYWALLED[site])) { | ||
336 | ret = PAYWALL_LADDER link | ||
337 | siloed = 1 | ||
338 | break | ||
339 | } | ||
340 | } | ||
330 | } | 341 | } |
331 | return ret | 342 | return ret |
332 | } | 343 | } |