5 Commits

4 changed files with 52 additions and 28 deletions
+1 -1
View File
@@ -1060,7 +1060,7 @@ loadAccounts();
<div class="site-footer-inner"> <div class="site-footer-inner">
<a href="https://git.arch-linux.cz/Mamutovo/fedi_start">Gitea repo</a> <a href="https://git.arch-linux.cz/Mamutovo/fedi_start">Gitea repo</a>
<a href="https://oscloud.cz">Oscloud</a> <a href="https://oscloud.cz">Oscloud</a>
<a href="https://gts.arch-linux.cz/@archos">@archos@gts.arch-linux.cz</a> <a href="https://mamutovo.cz/@archos">@archos@mamutovo.cz</a>
</div> </div>
</footer> </footer>
+9 -2
View File
@@ -21,7 +21,7 @@ jackc@kompost.cz,true,false,
ottovonwenkoff@mastodonczech.cz,true,false, ottovonwenkoff@mastodonczech.cz,true,false,
unreed@mastodonczech.cz,true,false, unreed@mastodonczech.cz,true,false,
tombarys@mastodon.social,true,false, tombarys@mastodon.social,true,false,
stepan@skorpil.cz,true,false, stepan@mastodon.skorpil.cz,true,false,
sumavanet@mastodonczech.cz,true,false, sumavanet@mastodonczech.cz,true,false,
honzakorinek@cztwitter.cz,true,false, honzakorinek@cztwitter.cz,true,false,
rezzabuh@mastodon.social,true,false, rezzabuh@mastodon.social,true,false,
@@ -96,5 +96,12 @@ architektradim@mastodonczech.cz,true,false,
nacelnik01@mamutovo.cz,true,false, nacelnik01@mamutovo.cz,true,false,
sledge@mastodonczech.cz,true,false, sledge@mastodonczech.cz,true,false,
tensob_@mastodonczech.cz,true,false tensob_@mastodonczech.cz,true,false
archos@gts.arch-linux.cz,true,false, archos@mamutovo.cz,true,false,
archlinux@mamutovo.cz,true,false, archlinux@mamutovo.cz,true,false,
electric@vaclavpasek.cz,true,false,
adamhavelka@mastodon.prorocketeers.com,true,false,
Kipe@mastodon.social,true,false,
zpravobot@zpravobot.news,true,false,
ozzelot@mstdn.social,true,false,
j4n3z@mastodon.social,true,false,
prahou@merveilles.town,true,false,
1 medvidekpu@mastodon.social true false
21 ottovonwenkoff@mastodonczech.cz true false
22 unreed@mastodonczech.cz true false
23 tombarys@mastodon.social true false
24 stepan@skorpil.cz stepan@mastodon.skorpil.cz true false
25 sumavanet@mastodonczech.cz true false
26 honzakorinek@cztwitter.cz true false
27 rezzabuh@mastodon.social true false
96 nacelnik01@mamutovo.cz true false
97 sledge@mastodonczech.cz true false
98 tensob_@mastodonczech.cz true false
99 archos@gts.arch-linux.cz archos@mamutovo.cz true false
100 archlinux@mamutovo.cz true false
101 electric@vaclavpasek.cz true false
102 adamhavelka@mastodon.prorocketeers.com true false
103 Kipe@mastodon.social true false
104 zpravobot@zpravobot.news true false
105 ozzelot@mstdn.social true false
106 j4n3z@mastodon.social true false
107 prahou@merveilles.town true false
+41 -24
View File
@@ -81,7 +81,7 @@ QUERY_INSTANCES = [
MIN_STATUSES = 10 MIN_STATUSES = 10
MIN_FOLLOWERS = 10 MIN_FOLLOWERS = 10
MAX_DAYS_INACTIVE = 90 MAX_DAYS_INACTIVE = 90
TOP_N = 200 TOP_N = 250
RATE_LIMIT_DELAY = 1.2 RATE_LIMIT_DELAY = 1.2
PAGE_LIMIT = 80 PAGE_LIMIT = 80
MAX_PAGES = 10 MAX_PAGES = 10
@@ -242,33 +242,50 @@ def extract_tags(acc):
return found[:4] return found[:4]
# ── VÝSTUP ──────────────────────────────────── # ── VÝSTUP ────────────────────────────────────
def _to_output(acc):
handle = acc.get("_handle", acc.get("acct", ""))
bio = re.sub(r"<[^>]+>", " ", acc.get("note", "") or "").strip()
return {
"name": acc.get("display_name") or acc.get("username", ""),
"handle": handle,
"bio": bio[:220],
"avatar": acc.get("avatar", ""),
"followers": acc.get("followers_count", 0),
"statuses": acc.get("statuses_count", 0),
"score": score(acc),
"tags": extract_tags(acc),
"category": categorize(acc),
"last_active": acc.get("last_status_at", ""),
"url": acc.get("url", ""),
}
def build_output(raw): def build_output(raw):
results = [] # Manuální účty vždy zahrnuty (bez ohledu na TOP_N)
for acc in raw:
if not acc.get("_manual") and not passes_quality(acc):
continue
handle = acc.get("_handle", acc.get("acct", ""))
bio = re.sub(r"<[^>]+>", " ", acc.get("note", "") or "").strip()
results.append({
"name": acc.get("display_name") or acc.get("username", ""),
"handle": handle,
"bio": bio[:220],
"avatar": acc.get("avatar", ""),
"followers": acc.get("followers_count", 0),
"statuses": acc.get("statuses_count", 0),
"score": score(acc),
"tags": extract_tags(acc),
"category": categorize(acc),
"last_active": acc.get("last_status_at", ""),
"url": acc.get("url", ""),
})
seen = set() seen = set()
unique = [] manual = []
for r in sorted(results, key=lambda x: x["followers"], reverse=True): for acc in raw:
if not acc.get("_manual"):
continue
r = _to_output(acc)
if r["handle"].lower() not in seen: if r["handle"].lower() not in seen:
seen.add(r["handle"].lower()) seen.add(r["handle"].lower())
unique.append(r) manual.append(r)
return unique[:TOP_N]
# Automatické účty doplní zbývající místa do TOP_N
auto_candidates = []
for acc in raw:
if acc.get("_manual"):
continue
if not passes_quality(acc):
continue
r = _to_output(acc)
if r["handle"].lower() not in seen:
seen.add(r["handle"].lower())
auto_candidates.append(r)
auto_candidates.sort(key=lambda x: x["followers"], reverse=True)
remaining = max(0, TOP_N - len(manual))
return manual + auto_candidates[:remaining]
def write_json(accounts, output_dir): def write_json(accounts, output_dir):
data = {"generated_at": datetime.now(timezone.utc).isoformat(), "count": len(accounts), "accounts": accounts} data = {"generated_at": datetime.now(timezone.utc).isoformat(), "count": len(accounts), "accounts": accounts}
+1 -1
View File
@@ -464,7 +464,7 @@ Rád/a poznám nové lidi 🙂 #Představení #novacek #cesky
</div> </div>
<div class="footer-note"> <div class="footer-note">
Zasekl/a ses? Napiš na <a href="https://gts.arch-linux.cz/@archos">@archos@gts.arch-linux.cz</a> nebo Zasekl/a ses? Napiš na <a href="https://mamutovo.cz/@archos">@archos@mamutovo.cz</a> nebo
se zeptej v <a href="https://mamutovo.cz/tags/pomoc">#pomoc</a>.<br> se zeptej v <a href="https://mamutovo.cz/tags/pomoc">#pomoc</a>.<br>
Tato stránka je open source: <a href="https://git.arch-linux.cz/Mamutovo/fedi_start">Gitea</a> · Tato stránka je open source: <a href="https://git.arch-linux.cz/Mamutovo/fedi_start">Gitea</a> ·
<a href="https://oscloud.cz">oscloud.cz</a> <a href="https://oscloud.cz">oscloud.cz</a>