about summary refs log tree commit diff stats
path: root/sfeed_html.sh
diff options
context:
space:
mode:
authorCase Duckworth2022-07-18 09:33:09 -0500
committerCase Duckworth2022-07-18 09:33:09 -0500
commit99dd02979bd263b80fad9b4859ddcaed58e46cc0 (patch)
tree4a901ee5f925a1ef5ac4836ff06e1bf66ca88973 /sfeed_html.sh
parentFilter titles and things (diff)
downloadsfeed-99dd02979bd263b80fad9b4859ddcaed58e46cc0.tar.gz
sfeed-99dd02979bd263b80fad9b4859ddcaed58e46cc0.zip
Convert youtube -> invidious
Diffstat (limited to 'sfeed_html.sh')
-rwxr-xr-xsfeed_html.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/sfeed_html.sh b/sfeed_html.sh index 86aad43..321d451 100755 --- a/sfeed_html.sh +++ b/sfeed_html.sh
@@ -67,6 +67,12 @@ $(for file in "$@"; do html_feed "$file"; done)
67EOF 67EOF
68} 68}
69 69
70filter_invidious() {
71 # Convert youtube links to invidious links
72 host="$(cat /tmp/invidious.host)"
73 sed "s@https://www\.youtube\.com@${host}@"
74}
75
70html_feed() { # html_feed FEED(file) => HTML 76html_feed() { # html_feed FEED(file) => HTML
71 filename="$(basename "$1")" 77 filename="$(basename "$1")"
72 now="$(date +%s)" 78 now="$(date +%s)"
@@ -136,7 +142,7 @@ html_feed() { # html_feed FEED(file) => HTML
136 printf "<a href=\"#%s\">%s</a></li>\n", NAME, NAME >> ASIDE 142 printf "<a href=\"#%s\">%s</a></li>\n", NAME, NAME >> ASIDE
137 } 143 }
138 printf "%s", (stamp ? stamp : ".") > "/dev/stderr" 144 printf "%s", (stamp ? stamp : ".") > "/dev/stderr"
139 }' "$1")" 145 }' "$1" | filter_invidious)"
140 if [ -z "$entries" ]; then return 1; fi 146 if [ -z "$entries" ]; then return 1; fi
141 echo "<section id=\"$filename\">" 147 echo "<section id=\"$filename\">"
142 # TODO: Include a link back to the website 148 # TODO: Include a link back to the website