-
Notifications
You must be signed in to change notification settings - Fork 4
/
followers.sp
122 lines (105 loc) · 2.22 KB
/
followers.sp
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
dashboard "Followers" {
tags = {
service = "Mastodon"
}
container {
text {
value = <<EOT
[Blocked](${local.host}/mastodon.dashboard.Blocked)
•
[Direct](${local.host}/mastodon.dashboard.Direct)
•
[Favorites](${local.host}/mastodon.dashboard.Favorites)
•
Followers
•
[Following](${local.host}/mastodon.dashboard.Following)
•
[Home](${local.host}/mastodon.dashboard.Home)
•
[List](${local.host}/mastodon.dashboard.List)
•
[Local](${local.host}/mastodon.dashboard.Local)
•
[Me](${local.host}/mastodon.dashboard.Me)
•
[Notification](${local.host}/mastodon.dashboard.Notification)
•
[PeopleSearch](${local.host}/mastodon.dashboard.PeopleSearch)
•
[Rate](${local.host}/mastodon.dashboard.Rate)
•
[Relationships](${local.host}/mastodon.dashboard.Relationships)
•
[Remote](${local.host}/mastodon.dashboard.Remote)
•
[Server](${local.host}/mastodon.dashboard.Server)
•
[StatusSearch](${local.host}/mastodon.dashboard.StatusSearch)
•
[TagExplore](${local.host}/mastodon.dashboard.TagExplore)
•
[TagSearch](${local.host}/mastodon.dashboard.TagSearch)
EOT
}
}
container {
table {
width = 4
query = query.connection
}
card {
width = 2
sql = "select count(*) as followers from mastodon_followers"
}
}
container {
chart {
width = 6
title = "followers by month of account creation"
sql = <<EOQ
select
to_char(created_at, 'YYYY-MM') as month,
count(*)
from
mastodon_followers
group by
month
EOQ
}
chart {
width = 6
type = "donut"
title = "followers by server"
sql = <<EOQ
with domains as (
select
(regexp_match(acct, '@(.+)'))[1] as domain
from
mastodon_followers
)
select
case
when domain is null then '${local.server}'
else domain
end as domain,
count(*)
from
domains
group by
domain
order by
count desc
limit 15
EOQ
}
}
container {
table {
query = query.followers
column "note" {
wrap = "all"
}
}
}
}