Add time to feed display

This commit is contained in:
Carter McBride 2024-06-18 22:19:54 -06:00
parent 3023fbfb60
commit 56b8cef868
4 changed files with 136 additions and 134 deletions

View file

@ -1,87 +1,87 @@
{ {
"Comics": [ "Comics": [
"http://www.catanacomics.com/rss", "http://www.catanacomics.com/rss",
"http://feeds.feedburner.com/InvisibleBread", "http://feeds.feedburner.com/InvisibleBread",
"https://hejibits.com/rss#_=_", "https://hejibits.com/rss#_=_",
"http://www.hrwiki.org/wiki/Special:Updates", "http://www.hrwiki.org/wiki/Special:Updates",
"http://rockpapercynic.tumblr.com/rss" "http://rockpapercynic.tumblr.com/rss"
], ],
"Podcasts": [ "Podcasts": [
"https://lilyandsam.show/feed", "https://lilyandsam.show/feed",
"https://technosapiens.substack.com/feed" "https://technosapiens.substack.com/feed"
], ],
"Friends and Family": [ "Friends and Family": [
"https://www.goodreads.com/review/list_rss/132710826?shelf=read", "https://www.goodreads.com/review/list_rss/132710826?shelf=read",
"https://jgm23333.wixsite.com/my-site/blog-feed.xml", "https://jgm23333.wixsite.com/my-site/blog-feed.xml",
"https://joekhoury.blog/feed/", "https://joekhoury.blog/feed/",
"https://social.warnick.me/users/sam.rss" "https://social.warnick.me/users/sam.rss"
], ],
"Games": [ "Games": [
"https://www.nomanssky.com/news/feed/", "https://www.nomanssky.com/news/feed/",
"https://www.lexaloffle.com/bbs/feed.php?uid=1", "https://www.lexaloffle.com/bbs/feed.php?uid=1",
"https://www.factorio.com/blog/rss", "https://www.factorio.com/blog/rss",
"https://kill-the-newsletter.com/feeds/pghhn8aaf264tukg.xml", "https://kill-the-newsletter.com/feeds/pghhn8aaf264tukg.xml",
"http://www.suppermariobroth.com/rss", "http://www.suppermariobroth.com/rss",
"http://unknownworlds.com/subnautica/feed/", "http://unknownworlds.com/subnautica/feed/",
"https://store.steampowered.com/feeds/news/app/1675200/?cc=US&l=english" "https://store.steampowered.com/feeds/news/app/1675200/?cc=US&l=english"
], ],
"Finance": [ "Finance": [
"http://feeds.feedburner.com/MrMoneyMustache", "http://feeds.feedburner.com/MrMoneyMustache",
"http://feeds.feedburner.com/DoctorOfCredit", "http://feeds.feedburner.com/DoctorOfCredit",
"https://kill-the-newsletter.com/feeds/tgor1vrwcf3f0uyo.xml", "https://kill-the-newsletter.com/feeds/tgor1vrwcf3f0uyo.xml",
"https://kill-the-newsletter.com/feeds/5q4gs79dfh32yr3h.xml" "https://kill-the-newsletter.com/feeds/5q4gs79dfh32yr3h.xml"
], ],
"News": [ "News": [
"http://www.economist.com/rss/the_world_this_week_rss.xml", "http://www.economist.com/rss/the_world_this_week_rss.xml",
"https://newsroom.churchofjesuschrist.org/rss", "https://newsroom.churchofjesuschrist.org/rss",
"http://feeds.feedburner.com/LdsChurchGrowth", "http://feeds.feedburner.com/LdsChurchGrowth",
"https://www.sltrib.com/arc/outboundfeeds/news/?outputType=xml", "https://www.sltrib.com/arc/outboundfeeds/news/?outputType=xml",
"https://www.ksl.com/rss/news/news_utah", "https://www.ksl.com/rss/news/news_utah",
"https://www.readtangle.com/posts/rss/" "https://www.readtangle.com/posts/rss/"
], ],
"Parenting": [ "Parenting": [
"https://technosapiens.substack.com/feed", "https://technosapiens.substack.com/feed",
"https://parentdata.org/feed/" "https://parentdata.org/feed/"
], ],
"Fashion": [ "Fashion": [
"http://www.heddels.com/feed/", "http://www.heddels.com/feed/",
"http://putthison.com/rss", "http://putthison.com/rss",
"https://articlesofinterest.substack.com/feed", "https://articlesofinterest.substack.com/feed",
"https://dappered.com/feed/", "https://dappered.com/feed/",
"https://dieworkwear.com/feed/", "https://dieworkwear.com/feed/",
"http://fromsqualortoballer.com/rss", "http://fromsqualortoballer.com/rss",
"https://fabricateurialist.substack.com/feed" "https://fabricateurialist.substack.com/feed"
], ],
"Products": [ "Products": [
"https://jellyfin.org/index.xml", "https://jellyfin.org/index.xml",
"https://gitlab.com/CalcProgrammer1/OpenRGB/-/tags?format=atom", "https://gitlab.com/CalcProgrammer1/OpenRGB/-/tags?format=atom",
"http://feeds.feedburner.com/psblog", "http://feeds.feedburner.com/psblog",
"https://matrix.org/blog/feed/", "https://matrix.org/blog/feed/",
"https://brave.com/feed/", "https://brave.com/feed/",
"https://bitwarden.com/blog/feed.xml" "https://bitwarden.com/blog/feed.xml"
], ],
"Humor": [ "Humor": [
"https://kill-the-newsletter.com/feeds/d90ng280lhh3p2nq.xml", "https://kill-the-newsletter.com/feeds/d90ng280lhh3p2nq.xml",
"http://www.altuniversebyu.com/feed/", "http://www.altuniversebyu.com/feed/",
"https://aiweirdness.com/rss", "https://aiweirdness.com/rss",
"http://mcmansionhell.tumblr.com/rss" "http://mcmansionhell.tumblr.com/rss"
], ],
"Other": [ "Other": [
"https://kill-the-newsletter.com/feeds/400aiwxy5ox6ao0d.xml", "https://kill-the-newsletter.com/feeds/400aiwxy5ox6ao0d.xml",
"http://brandonsanderson.com/feed/", "http://brandonsanderson.com/feed/",
"https://kill-the-newsletter.com/feeds/j3c4wngg2hpjmdt8.xml", "https://kill-the-newsletter.com/feeds/j3c4wngg2hpjmdt8.xml",
"https://astralcodexten.substack.com/feed/" "https://astralcodexten.substack.com/feed/"
], ],
"Tech News": [ "Tech News": [
"https://samwarnick.com/feed.rss", "https://samwarnick.com/feed.rss",
"http://feeds.feedburner.com/CssTricks", "http://feeds.feedburner.com/CssTricks",
"http://chriscoyier.net/feed/", "http://chriscoyier.net/feed/",
"https://jenniferdaniel.substack.com/feed/", "https://jenniferdaniel.substack.com/feed/",
"http://www.gamingonlinux.com/article_rss.php", "http://www.gamingonlinux.com/article_rss.php",
"http://www.theverge.com/rss/full.xml" "http://www.theverge.com/rss/full.xml"
], ],
"Emulation": [ "Emulation": [
"http://melonds.kuribo64.net/rss.php", "http://melonds.kuribo64.net/rss.php",
"https://dolphin-emu.org/blog/feeds/" "https://dolphin-emu.org/blog/feeds/"
] ]
} }

View file

@ -1,56 +1,53 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>🦉 Bubo Reader</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body>
<h1>🦉 Bubo Reader</h1>
{% for group, feeds in data %} <head>
<h2>{{ group }}</h2> <meta charset="UTF-8" />
{% for feed in feeds %} <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<details> <meta http-equiv="X-UA-Compatible" content="ie=edge" />
<summary> <title>🦉 Bubo Reader</title>
<span class="feed-title">{{ feed.title }}</span> <link rel="stylesheet" href="/style.css" />
<span class="feed-url">({{ feed.feed }})</span> </head>
</summary>
<ul> <body>
{% for item in feed.items %} <h1>🦉 Bubo Reader</h1>
<li>
{{ item.timestamp | formatDate }} - {% for group, feeds in data %}
<a <h2>{{ group }}</h2>
href="{{ item.link }}" {% for feed in feeds %}
target="_blank" <details>
rel="noopener norefferer nofollow" <summary>
>{{ item.title }}</a <span class="feed-title">{{ feed.title }}</span>
> <span class="feed-url">({{ feed.feed }})</span>
</li> </summary>
{% endfor %}
</ul>
</details>
{% endfor %} {% endfor %} {% if errors | length > 0 %}
<h2>Errors</h2>
<p>There were errors trying to parse these feeds:</p>
<ul> <ul>
{% for error in errors %} {% for item in feed.items %}
<li>{{ error }}</li> <li>
{{ item.timestamp | formatDate }} @ {{ item.timestamp | formatTime }}—
<a href="{{ item.link }}" target="_blank" rel="noopener norefferer nofollow">{{ item.title }}</a>
</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} </details>
{% endfor %} {% endfor %} {% if errors | length > 0 %}
<h2>Errors</h2>
<p>There were errors trying to parse these feeds:</p>
<ul>
{% for error in errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
<br />
<hr />
<p>Last updated {{ now }}.</p>
<p>
Powered by
<a href="https://github.com/georgemandis/bubo-rss">Bubo Reader (v{{ info.version }})</a>, a project by <a
href="https://george.mand.is">George Mandis</a>. ❤️
<a href="{{ info.funding.url }}">Sponsor on GitHub</a>
</p>
</body>
<br />
<hr />
<p>Last updated {{ now }}.</p>
<p>
Powered by
<a href="https://github.com/georgemandis/bubo-rss"
>Bubo Reader (v{{ info.version }})</a
>, a project by <a href="https://george.mand.is">George Mandis</a>. ❤️
<a href="{{ info.funding.url }}">Sponsor on GitHub</a>
</p>
</body>
</html> </html>

View file

@ -8,7 +8,7 @@
"scripts": { "scripts": {
"clean": "rm -rf dist", "clean": "rm -rf dist",
"build": "bun src/index.ts", "build": "bun src/index.ts",
"check": "biome check --write ./src ./eslint.config.js" "check": "biome check --write ./{src,config,public} ./eslint.config.js"
}, },
"author": { "author": {
"name": "George Mandis", "name": "George Mandis",

View file

@ -17,6 +17,11 @@ env.addFilter("formatDate", (dateString): string => {
return !Number.isNaN(date.getTime()) ? date.toLocaleDateString() : dateString; return !Number.isNaN(date.getTime()) ? date.toLocaleDateString() : dateString;
}); });
env.addFilter("formatTime", (dateString): string => {
const date: Date = new Date(Number.parseInt(dateString));
return !Number.isNaN(date.getTime()) ? date.toLocaleTimeString() : dateString;
});
env.addGlobal("now", new Date().toUTCString()); env.addGlobal("now", new Date().toUTCString());
// load the template // load the template