staalptkram/templates/marktplaats.html

76 lines
2 KiB
HTML

{##}
<html>
<head>
<meta http-equiv="refresh" content="{{refresh}}">
<title>
{{listings[0].title}}
({{dateparse(listings[0].date).astimezone(tz).strftime("%H:%M")}})
</title>
<style>
main {
font-family: sans-serif;
max-width: 600px;
margin: 0 auto;
}
h1 {
font-size: 1em;
}
.listing {
display: flex;
padding: 8px;
border-bottom: 1px solid rgba(0, 0, 0, .12);
box-sizing: border-box;
}
.listing:hover {
background-color: rgba(0, 0, 0, 0.1);
border-bottom: 1px solid rgba(0, 0, 0, 0);
}
.listing > div:first-child {
flex: 1;
}
a {
color: inherit;
text-decoration: none;
}
</style>
</head>
<body>
<main>
<form method="get">
URL: <input type="text" name="apiurl" value="{{apiurl}}" style="width: 530px" placeholder="https://www.marktplaats.nl/lrp/api/search?..."><br />
Refresh: <input type="text" name="refresh" value="{{refresh}}" style="width: 100px; text-align: right"> seconds (last update: {{now.strftime("%H:%M:%S")}}; next update: {{next.strftime("%H:%M:%S")}})<br />
<input type="submit" value="h">
</form>
{% for listing in listings %}
<a href="https://marktplaats.nl{{listing.vipUrl}}">
<div class="listing">
<div>
<h1>{{listing.title}}</h1>
<p>
&euro;{{ "{:.2f}".format(listing.priceInfo.priceCents / 100) }}
{{listing.priceInfo.priceType}}
<br>
{{dateparse(listing.date).astimezone(tz).strftime("%Y-%m-%d %H:%M:%S")}}
<br>
{{listing.location.cityName}} ({{listing.location.distanceMeters // 1000}} km)
</p>
</div>
{% for image in listing.imageUrls %}
<img src="{{ image }}" />
{% endfor %}
</div>
</a>
{% endfor %}
</main>
</body>
</html>