This commit is contained in:
Thomas Koch 2025-01-11 13:45:03 +02:00
parent 4a58996e44
commit 6e325179a2
4 changed files with 24 additions and 21 deletions

View File

@ -4,7 +4,6 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
# ammonia = "*" done by feed-rs
anyhow = "*" anyhow = "*"
clap = { version = "*", features = ["derive"] } clap = { version = "*", features = ["derive"] }
env_logger = "*" env_logger = "*"

View File

@ -41,7 +41,7 @@ impl FeedStore {
format!("{}.toml", self.feed_path(url)) format!("{}.toml", self.feed_path(url))
} }
pub fn get_fetchdata(&self, url: &Url) -> FetchData { pub fn load_fetchdata(&self, url: &Url) -> FetchData {
let path = self.fetchdata_path(url); let path = self.fetchdata_path(url);
if !fs::exists(path.clone()).unwrap() { if !fs::exists(path.clone()).unwrap() {
return FetchData::default(); return FetchData::default();

View File

@ -32,7 +32,7 @@ impl Fetcher {
} }
pub fn fetch(&self, url: Url, feed_store: &FeedStore) -> bool { pub fn fetch(&self, url: Url, feed_store: &FeedStore) -> bool {
let fetchdata = feed_store.get_fetchdata(&url); let fetchdata = feed_store.load_fetchdata(&url);
let mut builder = self let mut builder = self
.agent .agent
.get(url.to_string()) .get(url.to_string())

View File

@ -9,8 +9,11 @@
<link rel="alternate" type="application/xml+atom" title="Planet Haskell Atom Feed" href="atom.xml"> <link rel="alternate" type="application/xml+atom" title="Planet Haskell Atom Feed" href="atom.xml">
</head> </head>
<body> <body>
<header>
<h1>Planet TVL</h1>
</header>
<div id="maincontainer">
<main> <main>
<h1 class="tophead">Planet TVL</h1>
{% for entry in entries %} {% for entry in entries %}
<article> <article>
<h2><a href="{{entry.link}}">{{ entry.title|striptags }}<a></h2> <h2><a href="{{entry.link}}">{{ entry.title|striptags }}<a></h2>
@ -19,7 +22,7 @@
<div class="entry_content"> <div class="entry_content">
{{ entry.content }} {{ entry.content }}
</div> </div>
<p><a href="{{entry.link}}">full post<a></p> <p><a href="{{entry.link}}">full post</a></p>
</article> </article>
{% endfor %} {% endfor %}
</main> </main>
@ -28,5 +31,6 @@
<img src="logo.svg"> <img src="logo.svg">
<p>Last updated: {{now()|date(format="%Y-%m-%d %H:%M")}} <p>Last updated: {{now()|date(format="%Y-%m-%d %H:%M")}}
</aside> </aside>
</div>
</body> </body>
</html> </html>