Compare commits
12 Commits
a4ed559bb0
...
3460e45a37
| Author | SHA1 | Date | |
|---|---|---|---|
|
3460e45a37
|
|||
|
55359c25c3
|
|||
|
fe1ad16e50
|
|||
|
83992f6112
|
|||
|
1944c56d9c
|
|||
|
5d2931f314
|
|||
|
271d8b97c4
|
|||
|
596bfba1d0
|
|||
|
a52b9af100
|
|||
|
4f93d98747
|
|||
|
bd3322038b
|
|||
|
dd8d7d5b24
|
+2
-2
@@ -792,7 +792,7 @@ function avatarFallback(name) {
|
||||
|
||||
function cardHTML(a, idx) {
|
||||
const av = a.avatar || avatarFallback(a.name);
|
||||
const tags = (a.tags || []).slice(0, 3).map(t =>
|
||||
const tags = (a.tags || []).slice(0, 4).map(t =>
|
||||
`<span class="card-tag">#${t}</span>`).join('');
|
||||
|
||||
if (viewMode === 'list') {
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -451,14 +451,15 @@ h1 span { color: var(--accent); }
|
||||
|
||||
<!-- POČÍTAČ -->
|
||||
<div class="card" data-platforms="pocitac">
|
||||
<div class="app-logo"><img src="img/apps/mast.webp" alt="Mast"></div>
|
||||
<div class="app-logo"><img src="img/apps/tuba.svg" alt="Tuba"></div>
|
||||
<div class="card-body">
|
||||
<div class="card-name">Mast</div>
|
||||
<div class="card-name">Tuba</div>
|
||||
<div class="card-tags">
|
||||
<span class="tag tag-platform">Počítač</span>
|
||||
<span class="tag tag-paid">Placené</span>
|
||||
<span class="tag tag-free">Zdarma</span>
|
||||
<span class="tag tag-open">Otevřená</span>
|
||||
</div>
|
||||
<a href="https://apps.apple.com/app/mast-for-mastodon/id1437429129" class="btn-dl" target="_blank" rel="noopener">Stáhnout →</a>
|
||||
<a href="https://tuba.geopjr.dev" class="btn-dl" target="_blank" rel="noopener">Stáhnout →</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -218,6 +218,12 @@
|
||||
<p>Hashtagy jsou na Mastodonu důležité – slouží k objevování obsahu. Přidávej je na konec tootů. Můžeš sledovat i samotný hashtag a jeho příspěvky se ti budou zobrazovat v timeline. Příklady: <code>#cesky</code> <code>#fotografie</code> <code>#linux</code></p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>Zvýrazněné hashtagy</h2>
|
||||
<p>Nastav si zvýrazněné hashtagy – zobrazí se na tvém profilu a v seznamu CZ/SK účtů na <a href="https://fedi.mamutovo.cz">fedi.mamutovo.cz</a>.</p>
|
||||
<p style="margin-top:0.5rem;">Jak na to: <code>Předvolby → Profil → Zvýrazněné hashtagy</code></p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>Užitečné odkazy</h2>
|
||||
<ul>
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 51 KiB |
+11
-2
@@ -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,14 @@ 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,
|
||||
mirek@rodina-sucha.cz,true,false,
|
||||
sesivany@vivaldi.net,true,false,
|
||||
|
||||
|
+77
-38
@@ -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
|
||||
@@ -216,15 +216,28 @@ def score(acc):
|
||||
|
||||
# ── KATEGORIE ─────────────────────────────────
|
||||
CATEGORIES = {
|
||||
"tech": ["linux", "python", "programov", "software", "opensource", "developer", "sysadmin", "git"],
|
||||
"foto": ["fotografi", "foto", "photograph", "objektiv", "kamera"],
|
||||
"veda": ["věda", "fyzika", "biologi", "astronom", "výzkum", "science", "matematik"],
|
||||
"kultura": ["knihy", "literatura", "film", "hudba", "divadlo", "umění"],
|
||||
"gaming": ["gaming", "hry", "videohry", "steam", "gamer"],
|
||||
"zpravy": ["novinář", "zprávy", "politik", "média", "journalist"],
|
||||
"tech": ["linux", "python", "programov", "software", "opensource", "developer", "sysadmin", "git", "foss", "selfhosted", "homelab", "arch"],
|
||||
"foto": ["fotografi", "foto", "photograph", "objektiv", "kamera"],
|
||||
"veda": ["věda", "fyzika", "biologi", "astronom", "výzkum", "science", "matematik"],
|
||||
"kultura": ["knihy", "literatura", "film", "hudba", "divadlo", "umění"],
|
||||
"gaming": ["gaming", "hry", "videohry", "steam", "gamer"],
|
||||
"zpravy": ["novinář", "zprávy", "politik", "média", "journalist", "zpravy", "news", "aktualne"],
|
||||
"sport": ["sport", "fotbal", "hokej", "cycling", "running", "fitness", "tenis", "atletika", "cyklistika", "kolo", "beh", "plavani", "turistika"],
|
||||
"politika": ["politika", "politics", "czech", "democracy", "volby", "eu"],
|
||||
"fediverse": ["fediverse", "mastodon", "activitypub", "mamutovo"],
|
||||
"cestovani": ["cestovani", "cestování", "travel", "dovolena"],
|
||||
"priroda": ["příroda", "priroda", "les", "hory", "zahrada"],
|
||||
"jidlo": ["jídlo", "jidlo", "vareni", "vaření", "recept", "food"],
|
||||
}
|
||||
|
||||
def categorize(acc):
|
||||
# Primárně matchuj featured_tags proti CATEGORIES
|
||||
for tag in acc.get("_featured_tags", []):
|
||||
tag_lower = tag.lower()
|
||||
for cat, kws in CATEGORIES.items():
|
||||
if any(kw in tag_lower for kw in kws):
|
||||
return cat
|
||||
# Fallback: bio text + display_name
|
||||
text = re.sub(r"<[^>]+>", " ", acc.get("note", "") or "").lower()
|
||||
text += " " + (acc.get("display_name", "") or "").lower()
|
||||
for cat, kws in CATEGORIES.items():
|
||||
@@ -232,43 +245,69 @@ def categorize(acc):
|
||||
return cat
|
||||
return "ostatni"
|
||||
|
||||
def extract_tags(acc):
|
||||
text = re.sub(r"<[^>]+>", " ", acc.get("note", "") or "").lower()
|
||||
found = []
|
||||
for kws in CATEGORIES.values():
|
||||
for kw in kws:
|
||||
if kw in text and kw not in found and len(kw) > 3:
|
||||
found.append(kw.strip())
|
||||
return found[:4]
|
||||
def fetch_featured_tags(acc):
|
||||
if "_featured_tags" in acc:
|
||||
return acc["_featured_tags"]
|
||||
account_id = acc.get("id")
|
||||
instance = acc.get("_source_instance", "")
|
||||
if not account_id or not instance:
|
||||
acc["_featured_tags"] = []
|
||||
return []
|
||||
url = f"https://{instance}/api/v1/accounts/{account_id}/featured_tags"
|
||||
token = _token_for(instance)
|
||||
data = api_get(url, token=token)
|
||||
if not data or not isinstance(data, list):
|
||||
acc["_featured_tags"] = []
|
||||
return []
|
||||
tags = [t["name"] for t in data if isinstance(t, dict) and t.get("name")][:6]
|
||||
acc["_featured_tags"] = tags
|
||||
return tags
|
||||
|
||||
# ── 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": fetch_featured_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}
|
||||
|
||||
+1
-1
@@ -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