# -*- sh -*-
# SFEED="$HOME/.sfeed"
USER_AGENT='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'
# sfeedpath="$SFEED/feeds"
maxjobs="$(nproc)"
### Feeds #######################################################
feeds() {
feeds_planets
feeds_youtube
feeds_podcasts
feeds_friends
feeds_news
feeds_smolweb
feeds_comics
feeds_misc
feeds_me
}
feeds_planets() {
feed "Planet Emacs" "https://planet.emacslife.com/atom.xml"
feed "r/emacs" "http://old.reddit.com/r/emacs.rss"
feed "Planet Lisp" "https://planet.lisp.org/rss20.xml"
feed "Planet Scheme" "https://planet.scheme.org/atom.xml"
}
feeds_youtube() {
feed "3Blue1Brown" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCYO_jab_esuFRV4b17AJtAw'
feed "AB - Ancienne Belgique" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCUVAw2kdxJlcfCdEcdgXv5A'
feed "Abraham Moller" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCMfIwe2KHD2XoBO2lWqeFXg'
feed "Adam Ragusea" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC9_p50tH3WmMslWRWKnM7dQ'
feed "Babish Culinary Universe" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCJHA_jMfCvEnv-3kRjTCQXw'
feed "Baggers" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCMV8p6Lb-bd6UZtTc_QD4zA'
feed "Case Duckworth" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC92gRJdnUYklVu4pvj9n0Lw'
feed "Claire Saffitz x Dessert Person" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCvw6Y1kr_8bp6B5m1dqNyiw'
feed "Computerphile" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC9-y-6csu5WGm29I7JiwpnA'
feed "EBRPL Career Center" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCIvntuaxP7PyaJDeHE_9E8Q'
feed "EmacsConf and Emacs hangouts" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCwuyodzTl_KdEKNuJmeo99A'
feed "freeCodeCamp.org" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC8butISFwT-Wl7EV0hUK0BQ'
feed "Gavin Freeborn" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCJetJ7nDNLlEzDLXv7KIo0w'
feed "Henry Homesweet" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCZqjwc1Wy5t1rsviYYsJiYg'
feed "Howard Abrams" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCVHICXXtKG7rZgtC5xonNdQ'
feed "Ignite Talks" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCZotK8ZPTUNLMeW5Q6T0cKg'
feed "Jake B" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCBMMB7Yi0eyFuY95Qn2o0Yg'
feed "James Tomasino" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCbTp1BYjpuhDRG5OmgIT8iw'
feed "jan Misali" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCJOh5FKisc0hUlEeWFBlD-w'
feed "J Duckworth Animations" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCtAEaNVrNxAUy2VSRPD_PYQ'
feed "Jelle's Marble Runs" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCYJdpnjuSWVOLgGT9fIzL0g'
feed "John Kitchin" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCQp2VLAOlvq142YN3JO3y8w'
feed "karthik" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCbh_g91w0T6OYp40xFrtnhA'
feed "Ken Forkish" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCvVvFZd0e86bLbd5FdgYiUg'
feed "Lex Fridman" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCSHZKyawb77ixDdsGog4iWA'
feed "LockPickingLawyer" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCm9K6rby98W8JigLoZOh6FQ'
feed "Maangchi" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC8gFadPgK2r1ndqLI04Xvvw'
feed "Mike Zamansky" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCxkMDXQ5qzYOgXPRnOBrp1w'
feed "MIT OpenCourseWare" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCEBb1b_L6zDS3xTUrIALZOw'
feed "My Analog Journal" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC8TZwtZ17WKFJSmwTZQpBTA'
feed "Nat's What I Reckon" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCEFW1E8QzP-hKxjO2Rj68wg'
feed "Now You See It" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCWTFGPpNQ0Ms6afXhaWDiRw'
feed "Numberphile" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCoxcjq-8xIDTYp3uz647V5A'
feed "Philosophy Tube" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC2PA-AKmVpU6NKCGtZq_rKQ'
feed "PronunciationManual" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCqDSLtXeZsGc3dtVb5MW13g'
feed "Protesilaos Stavrou" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC0uTPqBCFIpZxlz_Lv1tk_g'
feed "RailCowGirl" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCj-Xm8j6WBgKY8OG7s9r2vQ'
feed "Simone Giertz" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC3KEoMzNz8eYnwBC34RaKCQ'
feed "Steve Yegge" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC2RCcnTltR3HMQOYVqwmweA'
feed "System Crafters" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCAiiOTio8Yu69c3XnR7nQBQ'
feed "Tasting History with Max Miller" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCsaGKqPZnGp_7N80hcHySGQ'
feed "Technology Connections" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCy0tKL1T7wFoYcxCe0xjN6Q'
feed "Too Many Zooz" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCtjXVqMVzBIgU0SO8AV0vPg'
feed "Townsends" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCxr2d4As312LulcajAkKJYw'
feed "Unitarian Church of Baton Rouge" 'https://www.youtube.com/feeds/videos.xml?channel_id=UClrqHvbiFM-1hn931ZmAPFw'
feed "Vulf" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCtWuB1D_E3mcyYThA9iKggQ'
feed "WFTDA: Women's Flat Track Derby Association" 'https://www.youtube.com/feeds/videos.xml?channel_id=UC7eMWpvytqd3gYAqxTl9w7g'
feed "Zach Anner" 'https://www.youtube.com/feeds/videos.xml?channel_id=UCPTVYxUoYWhNa8J7GzIGnyQ'
}
feeds_podcasts() {
feed "Tilde Whirl Tildeverse Podcast" 'https://tilde.town/~dozens/podcast/rss.xml'
feed "trash cat tech cat" 'https://podcast.librepunk.club/tctc/ogg.xml'
feed "Hacker Public Radio" 'https://hackerpublicradio.org/hpr_ogg_rss.php'
}
feeds_friends() {
# nihilazo
feed "lipu pi jan Niko" 'https://tilde.town/~nihilazo/index.xml'
# dozens
feed "chrismanbrown.gitlab.io (dozens)" 'https://chrismanbrown.gitlab.io/rss.xml'
feed "Dozens and Dragons" 'https://dozensanddragons.neocities.org/rss.xml'
feed "dozens: Society For Putting Things On Top Of Other Things" 'https://society.neocities.org/rss.xml'
feed "dozens: vgnfdblg" 'https://supervegan.neocities.org/feed.xml'
feed "dozens: backgammon" 'http://tilde.town/~dozens/backgammon/rss.xml'
feed "dozens: It's Pro Toad and Superb Owl" 'https://git.tilde.town/dozens/protoadandsuperbowl/raw/branch/master/feed.xml'
feed "dozens dreams" 'https://tilde.team/~dozens/dreams/rss.xml'
feed "dozens: write.as" 'https://write.tildeverse.org/dozens/feed/'
feed "dozens css art" 'http://tilde.town/~dozens/cssart/feed.xml'
###
feed "Benjamin Wil" 'https://benjaminwil.info/feed.xml'
feed "(lambda (x) (create x))" 'http://lambdacreate.com/static/feed.rss'
feed "m455.casa" 'https://m455.casa/feed.rss'
feed "Oatmeal" 'https://eli.li/feed.rss'
feed "RSRSSS" 'https://envs.net/~lucidiot/rsrsss/feed.xml'
feed "Tomasino Blog" 'https://blog.tomasino.org/index.xml'
feed "Tomasino Labs" 'https://labs.tomasino.org/index.xml'
feed "Will's Blog" 'https://wflewis.com/feed.xml'
feed "Rick Carlino's Blog" 'https://rickcarlino.com/rss/feed.rss'
feed "Causal Agency" 'https://text.causal.agency/feed.atom'
feed "Benoit Joly" 'https://blog.benoitj.ca/posts/index.xml'
feed "p1k3::feed" 'https://p1k3.com/feed'
feed "linkbudz" 'https://linkbudz.m455.casa/feed.rss'
feed "Alex Schroeder" "https://alexschroeder.ch/wiki/feed/full/"
feed "Björn Wärmedal" "https://warmedal.se/~bjorn/atom.xml"
feed "a rickety bridge of impossible crossing" "https://bluelander.bearblog.dev/feed/"
}
feeds_comics() {
feed "Cat and Girl" 'https://catandgirl.com/feed/'
feed "Dinosaur Comics!" 'https://qwantz.com/rssfeed.php'
feed "False Knees" 'https://falseknees.tumblr.com/rss'
feed "Saturday Morning Breakfast Cereal" 'https://www.smbc-comics.com/comic/rss'
feed "xkcd" 'https://xkcd.com/atom.xml'
}
feeds_news() {
feed "Hacker News" 'https://news.ycombinator.com/rss'
feed "lobste.rs" 'https://lobste.rs/rss'
feed "tilde news" 'https://tilde.news/rss'
feed "Tildes Atom feed" 'https://tildes.net/topics.atom'
feed "NPR" "https://feeds.npr.org/1001/rss.xml"
}
feeds_me() {
:
}
feeds_smolweb() {
feed "~town friday postcard" 'https://tilde.town/~lucidiot/fridaypostcard.xml'
feed "Cosmic Voyage" 'https://cosmic.voyage/rss.xml'
feed "plan.cat" 'https://plan.cat/rss'
}
feeds_misc() {
feed "Crystalverse" 'https://crystalverse.com/feed/'
feed "Hetzner" 'https://status.hetzner.com/en.atom'
feed "LOW-TECH MAGAZINE" 'https://feeds2.feedburner.com/typepad/krisdedecker/lowtechmagazineenglish'
}
### Filter ######################################################
filter() {
case "$1" in
# Filter items based on feed name.
*'Hacker News'*)
# Hacker news is stupid and doesn't include IDs, and
# instead includes a comments tag in its body.
awk 'BEGIN {FS="\t"; OFS="\t"} {
$6 = $4
sub(/^.*$/,"", $6)
print
}'
;;
*NPR*)
sed 's@www\.npr\.org@text.npr.org@'
;;
r_* | r/*) # reddit (not sure when / => _)
reddit_alt_url="i.reddit.com" # teddit is slow :(
sed -e "s@old\.reddit\.com@${reddit_alt_url}@" \
-e "s@reddit\.com@${reddit_alt_url}@"
;;
'Saturday Morning Breakfast Cereal')
sed 's@Saturday Morning Breakfast Cereal - @@'
;;
*) cat ;;
esac |
filter_add_empties |
filter_html_entities |
filter_embed_youtube |
filter_filter_links
}
filter_add_empties() {
awk 'BEGIN{FS="\t";OFS=FS;}
{ $2 = $2 ? $2 : "[empty]" }
{ print $1,$2,$3,$4,$5,$6,$7,$8,$9; }
'
}
filter_embed_youtube() {
# replace youtube links with embed links
sed 's@www\.youtube\.com/watch?v=@www.youtube.com/embed/@g'
}
filter_filter_links() {
# shorten feedburner links and strip tracking parameters and pixels
awk -F '\t' 'BEGIN { OFS = "\t"; }
function filterlink(s) {
# protocol must start with http, https or gopher.
if (match(s, /^(http|https|gopher):\/\//) == 0) {
return "";
}
# shorten feedburner links.
if (match(s, /^(http|https):\/\/[^\/]+\/~r\/.*\/~3\/[^\/]+\//)) {
s = substr($3, RSTART, RLENGTH);
}
# strip tracking parameters
# urchin, facebook, piwik, webtrekk and generic.
gsub(/\?(ad|campaign|fbclid|pk|tm|utm|wt)_([^&]+)/, "?", s);
gsub(/&(ad|campaign|fbclid|pk|tm|utm|wt)_([^&]+)/, "", s);
gsub(/\?&/, "?", s);
gsub(/[\?&]+$/, "", s);
return s
}
{
$3 = filterlink($3); # link
$8 = filterlink($8); # enclosure
# try to remove tracking pixels: tags with 1px width or height.
gsub("]*(width|height)[[:space:]]*=[[:space:]]*[\"'"'"' ]?1[\"'"'"' ]?[^0-9>]+[^>]*>", "", $4);
print $0;
}'
}
filter_html_entities() {
# convert HTML entities into dumb counterparts
# (and weird shit to normal shit, too)
awk '{
gsub(/"/,"\""); gsub(/"/,"\"");
gsub(/'/,"'\''"); gsub(/'/,"'\''");
gsub(/’/,"'\''");
gsub(/&/,"\\&"); # MUST BE LAST!;
print
}'
}
# Fetch #########################################################
fetch() { # fetch(name, url, feedfile)
"${NOFETCH:-false}" && return
curl -s -L \
--max-redirs 3 \
--header "'User-Agent: $USER_AGENT'" \
--fail \
--max-time 15 \
"$2"
}