about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xsfeed_html.awk11
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}