about summary refs log tree commit diff stats
path: root/sfeed_html.sh
diff options
context:
space:
mode:
authorCase Duckworth2022-07-19 15:00:46 -0500
committerCase Duckworth2022-07-19 15:00:46 -0500
commitf9d86ec57f17b320d8dc2e9f63618cbd5cbbb25a (patch)
treeba8d4c5d14ed455f994355faa1934d7dc7f33307 /sfeed_html.sh
parentImprove logging (diff)
downloadsfeed-f9d86ec57f17b320d8dc2e9f63618cbd5cbbb25a.tar.gz
sfeed-f9d86ec57f17b320d8dc2e9f63618cbd5cbbb25a.zip
Add further silo processing
Diffstat (limited to 'sfeed_html.sh')
-rwxr-xr-xsfeed_html.sh17
1 files changed, 13 insertions, 4 deletions
diff --git a/sfeed_html.sh b/sfeed_html.sh index 9fc749d..b245f0b 100755 --- a/sfeed_html.sh +++ b/sfeed_html.sh
@@ -69,8 +69,9 @@ EOF
69 69
70filter_invidious() { 70filter_invidious() {
71 # Convert youtube links to invidious links 71 # Convert youtube links to invidious links
72 host="$(cat /tmp/invidious.host)" 72 sed -e "s@https://www\.youtube\.com@https://invidious.snopyta.org@" \
73 sed "s@https://www\.youtube\.com@${host}@" 73 -e 's@https://i\.reddit\.com@https://libreddit.spike.codes@' \
74 -e 's@https://twitter\.com@https://nitter.net@'
74} 75}
75 76
76html_feed() { # html_feed FEED(file) => HTML 77html_feed() { # html_feed FEED(file) => HTML
@@ -136,7 +137,7 @@ html_feed() { # html_feed FEED(file) => HTML
136 printf "%s", "<a href=\"" id "\" target=\"_blank\">" stamp "</a>" 137 printf "%s", "<a href=\"" id "\" target=\"_blank\">" stamp "</a>"
137 } 138 }
138 print "</td>" 139 print "</td>"
139 printf "<td class=\"entry-title%s", (link ~ /youtube/ ? " youtube" : "") 140 printf "<td class=\"entry-title%s", silo_links(link)
140 print "\"><a href=\"" link "\" target=\"_blank\">" title "</a></td>" 141 print "\"><a href=\"" link "\" target=\"_blank\">" title "</a></td>"
141 print "</tr>" 142 print "</tr>"
142 } 143 }
@@ -146,7 +147,15 @@ html_feed() { # html_feed FEED(file) => HTML
146 printf "<a%s href=\"#%s\">%s</a></li>\n", (yt ? " class=\"yt\"" : ""), FNAME, NAME >> ASIDE 147 printf "<a%s href=\"#%s\">%s</a></li>\n", (yt ? " class=\"yt\"" : ""), FNAME, NAME >> ASIDE
147 } 148 }
148 printf "%s", (stamp ? stamp : ".") > "/dev/stderr" 149 printf "%s", (stamp ? stamp : ".") > "/dev/stderr"
149 }' "$1" | filter_invidious)" 150 }
151function silo_links(link) {
152 if (link ~ /youtube\.com/) return " youtube"
153 if (link ~ /facebook\.com/) return " facebook"
154 if (link ~ /twitter\.com/) return " twitter"
155 if (link ~ /reddit\.com/) return " reddit"
156 return ""
157}
158' "$1" | filter_invidious)"
150 if [ -z "$entries" ]; then return 1; fi 159 if [ -z "$entries" ]; then return 1; fi
151 echo "<section id=\"$filename\">" 160 echo "<section id=\"$filename\">"
152 # TODO: Include a link back to the website 161 # TODO: Include a link back to the website