-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstatistik.twig
94 lines (78 loc) · 4.12 KB
/
statistik.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{% set sum = 0 %}
{% set count = 0 %}
{% for episode in podcast.episodes %}
{% set sum = sum + episode.duration.totalMilliseconds %}
{% set count = count + 1 %}
{% endfor %}
<p>Bisher haben wir <b>{{ count }} Folgen</b> veröffentlicht die <b>im Durchschnitt {{ (sum / count / 1000 / 60)|round(0, 'floor') }} Minuten</b> lang sind. In Summe haben wir schon <b>{{ (sum / 1000 / 60)|round(0, 'floor') }} Minuten gepodcasted</b>, das sind <b>{{ (sum / 1000 / 60 / 60)|round(2) }} Stunden</b>.</p>
<h2>Downloads</h2>
{% set latest = podcast.episodes[0] %}
<p>Unsere aktuelle Folge (<a href="{{ latest.url }}"><b>{{ latest.title }}</b></a>) hat bisher <b>{{ latest.total_downloads }} Downloads</b>. {% if not latest.meta('_podlove_downloads_2d') is empty %} In den ersten 48 Stunden waren es <b>{{ latest.meta('_podlove_downloads_2d') }} Abrufe</b>.{% endif %}</p>
<script src="https://unpkg.com/chartkick@4.0.4/dist/chartkick.js"></script>
<script src="https://unpkg.com/chart.js@3.3.2/dist/chart.js"></script
<script src="https://unpkg.com/chartjs-adapter-date-fns@2.0.0/dist/chartjs-adapter-date-fns.bundle.js"></script>
<!--
<script src="/wp-content/uploads/js/chartkick.js"></script>
<script src="/wp-content/uploads/js/chart.js"></script>
<script src="/wp-content/uploads/js/chartjs-adapter-date-fns.bundle.js"></script>
-->
<div id="all-episodes" style="height: 300px;"></div>
<script>
new Chartkick.ColumnChart("all-episodes", [
{% for episode in podcast.episodes({publicationDate: 'title', 'order': 'ASC'})|filter(e => e.total_downloads > 0) %}
["{{ episode.title|escape('js') }}", {{ episode.total_downloads|escape('js') }}],
{% endfor %}
]);
</script>
<p></p>
<p>Gezählt werden <a href="https://docs.podlove.org/podlove-publisher/reference/download-analytics">Downloadversuche</a>.</p>
<h3>Unsere beliebtesten Folgen</h3>
<ul>
{% for episode in podcast.episodes|filter(e => e.total_downloads > 0)|sort((b, a) => a.total_downloads <=> b.total_downloads)|slice(0,5) %}
<li>
<a href="{{ episode.url }}"><b>{{ episode.title }}</b></a> ({{ episode.total_downloads }} Downloads)
</li>
{% endfor %}
</ul>
<h3>Unsere Folgen mit Potential</h3>
<ul>
{% for episode in podcast.episodes|filter(e => e.total_downloads > 0)|sort((a, b) => a.total_downloads <=> b.total_downloads)|slice(0,5) %}
<li>
<a href="{{ episode.url }}"><b>{{ episode.title }}</b></a> ({{ episode.total_downloads }} Downloads)
</li>
{% endfor %}
</ul>
<h2>Folgenlänge</h2>
<div id="episode-length" style="height: 300px;"></div>
<script>
new Chartkick.ColumnChart("episode-length", [
{% for episode in podcast.episodes({publicationDate: 'title', 'order': 'ASC'})|filter(e => e.total_downloads > 0) %}
["{{ episode.title|escape('js') }}", {{ (episode.duration.totalMilliseconds / 1000 / 60)|round(0, 'floor') }}],
{% endfor %}
]);
</script>
<h3>Unsere längsten Folgen</h3>
<ul>
{% for episode in podcast.episodes|filter(e => e.duration.totalMilliseconds > 0)|sort((b, a) => a.duration.totalMilliseconds <=> b.duration.totalMilliseconds)|slice(0,5) %}
<li>
<a href="{{ episode.url }}"><b>{{ episode.title }}</b></a> ({{ episode.duration }})
</li>
{% endfor %}
</ul>
<h3>Unsere kürzesten Folgen</h3>
<ul>
{% for episode in podcast.episodes|filter(e => e.duration.totalMilliseconds > 0)|sort((a, b) => a.duration.totalMilliseconds <=> b.duration.totalMilliseconds)|slice(0,5) %}
<li>
<a href="{{ episode.url }}"><b>{{ episode.title }}</b></a> ({{ episode.duration }})
</li>
{% endfor %}
</ul>
<h2>Unsere meist diskutierten Folgen</h2>
<ul>
{% for episode in podcast.episodes|sort((b, a) => a.post.comment_count <=> b.post.comment_count)|slice(0,5) %}
<li>
<a href="{{ episode.url }}#comments"><b>{{ episode.title }}</b></a> ({{ episode.post.comment_count }} Kommentare)
</li>
{% endfor %}
</ul>
<p>Ihr wollt die Statistik auch für euren Podlove-Podcast? Das <a href="https://github.com/poschi3/podlove-publisher-templates">Template findet ihr auf Github</a>.</p>