stuff
This commit is contained in:
parent
4a58996e44
commit
6e325179a2
@ -4,7 +4,6 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
# ammonia = "*" done by feed-rs
|
||||
anyhow = "*"
|
||||
clap = { version = "*", features = ["derive"] }
|
||||
env_logger = "*"
|
||||
|
@ -41,7 +41,7 @@ impl FeedStore {
|
||||
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);
|
||||
if !fs::exists(path.clone()).unwrap() {
|
||||
return FetchData::default();
|
||||
|
@ -32,7 +32,7 @@ impl Fetcher {
|
||||
}
|
||||
|
||||
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
|
||||
.agent
|
||||
.get(url.to_string())
|
||||
|
@ -9,24 +9,28 @@
|
||||
<link rel="alternate" type="application/xml+atom" title="Planet Haskell Atom Feed" href="atom.xml">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1 class="tophead">Planet TVL</h1>
|
||||
{% for entry in entries %}
|
||||
<article>
|
||||
<h2><a href="{{entry.link}}">{{ entry.title|striptags }}<a></h2>
|
||||
<date>{% if entry.published %}{{ entry.published | date(format="%Y-%m-%d %H:%M", timezone="Europe/Moscow") }}{% endif %}</date>{# todo: maybe group posts by day? #}
|
||||
<p class="entry_author">{{ entry.author|striptags }}</p>
|
||||
<div class="entry_content">
|
||||
{{ entry.content }}
|
||||
</div>
|
||||
<p><a href="{{entry.link}}">full post<a></p>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</main>
|
||||
<header>
|
||||
<h1>Planet TVL</h1>
|
||||
</header>
|
||||
<div id="maincontainer">
|
||||
<main>
|
||||
{% for entry in entries %}
|
||||
<article>
|
||||
<h2><a href="{{entry.link}}">{{ entry.title|striptags }}<a></h2>
|
||||
<date>{% if entry.published %}{{ entry.published | date(format="%Y-%m-%d %H:%M", timezone="Europe/Moscow") }}{% endif %}</date>{# todo: maybe group posts by day? #}
|
||||
<p class="entry_author">{{ entry.author|striptags }}</p>
|
||||
<div class="entry_content">
|
||||
{{ entry.content }}
|
||||
</div>
|
||||
<p><a href="{{entry.link}}">full post</a></p>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</main>
|
||||
|
||||
<aside>
|
||||
<img src="logo.svg">
|
||||
<p>Last updated: {{now()|date(format="%Y-%m-%d %H:%M")}}
|
||||
</aside>
|
||||
<aside>
|
||||
<img src="logo.svg">
|
||||
<p>Last updated: {{now()|date(format="%Y-%m-%d %H:%M")}}
|
||||
</aside>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user