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) {
|
function cardHTML(a, idx) {
|
||||||
const av = a.avatar || avatarFallback(a.name);
|
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('');
|
`<span class="card-tag">#${t}</span>`).join('');
|
||||||
|
|
||||||
if (viewMode === 'list') {
|
if (viewMode === 'list') {
|
||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -451,14 +451,15 @@ h1 span { color: var(--accent); }
|
|||||||
|
|
||||||
<!-- POČÍTAČ -->
|
<!-- POČÍTAČ -->
|
||||||
<div class="card" data-platforms="pocitac">
|
<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-body">
|
||||||
<div class="card-name">Mast</div>
|
<div class="card-name">Tuba</div>
|
||||||
<div class="card-tags">
|
<div class="card-tags">
|
||||||
<span class="tag tag-platform">Počítač</span>
|
<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>
|
</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>
|
||||||
</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>
|
<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>
|
||||||
|
|
||||||
|
<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">
|
<div class="section">
|
||||||
<h2>Užitečné odkazy</h2>
|
<h2>Užitečné odkazy</h2>
|
||||||
<ul>
|
<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,
|
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,14 @@ 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,
|
||||||
|
mirek@rodina-sucha.cz,true,false,
|
||||||
|
sesivany@vivaldi.net,true,false,
|
||||||
|
|||||||
|
+77
-38
@@ -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
|
||||||
@@ -216,15 +216,28 @@ def score(acc):
|
|||||||
|
|
||||||
# ── KATEGORIE ─────────────────────────────────
|
# ── KATEGORIE ─────────────────────────────────
|
||||||
CATEGORIES = {
|
CATEGORIES = {
|
||||||
"tech": ["linux", "python", "programov", "software", "opensource", "developer", "sysadmin", "git"],
|
"tech": ["linux", "python", "programov", "software", "opensource", "developer", "sysadmin", "git", "foss", "selfhosted", "homelab", "arch"],
|
||||||
"foto": ["fotografi", "foto", "photograph", "objektiv", "kamera"],
|
"foto": ["fotografi", "foto", "photograph", "objektiv", "kamera"],
|
||||||
"veda": ["věda", "fyzika", "biologi", "astronom", "výzkum", "science", "matematik"],
|
"veda": ["věda", "fyzika", "biologi", "astronom", "výzkum", "science", "matematik"],
|
||||||
"kultura": ["knihy", "literatura", "film", "hudba", "divadlo", "umění"],
|
"kultura": ["knihy", "literatura", "film", "hudba", "divadlo", "umění"],
|
||||||
"gaming": ["gaming", "hry", "videohry", "steam", "gamer"],
|
"gaming": ["gaming", "hry", "videohry", "steam", "gamer"],
|
||||||
"zpravy": ["novinář", "zprávy", "politik", "média", "journalist"],
|
"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):
|
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 = re.sub(r"<[^>]+>", " ", acc.get("note", "") or "").lower()
|
||||||
text += " " + (acc.get("display_name", "") or "").lower()
|
text += " " + (acc.get("display_name", "") or "").lower()
|
||||||
for cat, kws in CATEGORIES.items():
|
for cat, kws in CATEGORIES.items():
|
||||||
@@ -232,43 +245,69 @@ def categorize(acc):
|
|||||||
return cat
|
return cat
|
||||||
return "ostatni"
|
return "ostatni"
|
||||||
|
|
||||||
def extract_tags(acc):
|
def fetch_featured_tags(acc):
|
||||||
text = re.sub(r"<[^>]+>", " ", acc.get("note", "") or "").lower()
|
if "_featured_tags" in acc:
|
||||||
found = []
|
return acc["_featured_tags"]
|
||||||
for kws in CATEGORIES.values():
|
account_id = acc.get("id")
|
||||||
for kw in kws:
|
instance = acc.get("_source_instance", "")
|
||||||
if kw in text and kw not in found and len(kw) > 3:
|
if not account_id or not instance:
|
||||||
found.append(kw.strip())
|
acc["_featured_tags"] = []
|
||||||
return found[:4]
|
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 ────────────────────────────────────
|
# ── 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):
|
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
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user