Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
271d8b97c4
|
|||
|
596bfba1d0
|
|||
|
a52b9af100
|
|||
|
4f93d98747
|
|||
|
bd3322038b
|
@@ -1060,7 +1060,7 @@ loadAccounts();
|
||||
<div class="site-footer-inner">
|
||||
<a href="https://git.arch-linux.cz/Mamutovo/fedi_start">Gitea repo</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>
|
||||
</footer>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ jackc@kompost.cz,true,false,
|
||||
ottovonwenkoff@mastodonczech.cz,true,false,
|
||||
unreed@mastodonczech.cz,true,false,
|
||||
tombarys@mastodon.social,true,false,
|
||||
stepan@skorpil.cz,true,false,
|
||||
stepan@mastodon.skorpil.cz,true,false,
|
||||
sumavanet@mastodonczech.cz,true,false,
|
||||
honzakorinek@cztwitter.cz,true,false,
|
||||
rezzabuh@mastodon.social,true,false,
|
||||
@@ -96,5 +96,12 @@ architektradim@mastodonczech.cz,true,false,
|
||||
nacelnik01@mamutovo.cz,true,false,
|
||||
sledge@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,
|
||||
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,
|
||||
|
||||
|
@@ -81,7 +81,7 @@ QUERY_INSTANCES = [
|
||||
MIN_STATUSES = 10
|
||||
MIN_FOLLOWERS = 10
|
||||
MAX_DAYS_INACTIVE = 90
|
||||
TOP_N = 200
|
||||
TOP_N = 250
|
||||
RATE_LIMIT_DELAY = 1.2
|
||||
PAGE_LIMIT = 80
|
||||
MAX_PAGES = 10
|
||||
@@ -242,33 +242,50 @@ def extract_tags(acc):
|
||||
return found[:4]
|
||||
|
||||
# ── 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):
|
||||
results = []
|
||||
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", ""),
|
||||
})
|
||||
# Manuální účty vždy zahrnuty (bez ohledu na TOP_N)
|
||||
seen = set()
|
||||
unique = []
|
||||
for r in sorted(results, key=lambda x: x["followers"], reverse=True):
|
||||
manual = []
|
||||
for acc in raw:
|
||||
if not acc.get("_manual"):
|
||||
continue
|
||||
r = _to_output(acc)
|
||||
if r["handle"].lower() not in seen:
|
||||
seen.add(r["handle"].lower())
|
||||
unique.append(r)
|
||||
return unique[:TOP_N]
|
||||
manual.append(r)
|
||||
|
||||
# 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):
|
||||
data = {"generated_at": datetime.now(timezone.utc).isoformat(), "count": len(accounts), "accounts": accounts}
|
||||
|
||||
@@ -464,7 +464,7 @@ Rád/a poznám nové lidi 🙂 #Představení #novacek #cesky
|
||||
</div>
|
||||
|
||||
<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>
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user