diff options
Diffstat (limited to 'sfeed_html.sh')
-rwxr-xr-x | sfeed_html.sh | 17 |
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 | ||
70 | filter_invidious() { | 70 | filter_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 | ||
76 | html_feed() { # html_feed FEED(file) => HTML | 77 | html_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 | } |
151 | function 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 |