הצעת ייעול | פוסטים פופולאריים
-
@userbot סקריפט לטמפרמונקי לכפתור פופולארי בסרגל הצד בפורום. 5 דק' עם AI...
// ==UserScript== // @name הוספת 'פופולארי' לסרגל הצד במתמחים טופ // @namespace http://tampermonkey.net/ // @version 0.4 // @description מוסיף קישור "פופולארי" לסרגל הצד בפורום מתמחים טופ, עם tooltip, אחרי "נושאים שלא נפתרו" // @author לאצי&AI // @match https://mitmachim.top/* // @grant none // @run-at document-idle // ==/UserScript== (function() { 'use strict'; const LINK_ID = 'custom-popular-link-li'; // ID ייחודי לאלמנט החדש const LINK_URL = 'https://mitmachim.top/popular'; const LINK_TEXT = 'פופולארי'; const LINK_ICON_CLASS = 'fa-fire'; // אפשר לשנות ל- fa-star, fa-line-chart, fa-trophy וכו' // פונקציה לאתחול tooltip על אלמנט ספציפי function initializeTooltip(element) { if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { new bootstrap.Tooltip(element); } else { let attempts = 0; const maxAttempts = 15; const intervalId = setInterval(() => { attempts++; if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { clearInterval(intervalId); new bootstrap.Tooltip(element); } else if (attempts >= maxAttempts) { clearInterval(intervalId); console.warn('Tampermonkey: Bootstrap Tooltip function not found after ' + maxAttempts + ' attempts. Tooltip for new element might not work.'); } }, 200); } } function addPopularLink() { if (document.getElementById(LINK_ID)) { return; } const mainNav = document.getElementById('main-nav'); if (mainNav) { const listItem = document.createElement('li'); listItem.id = LINK_ID; listItem.className = 'nav-item mx-2'; listItem.setAttribute('data-bs-toggle', 'tooltip'); listItem.setAttribute('data-bs-placement', 'right'); listItem.setAttribute('title', LINK_TEXT); const linkElement = document.createElement('a'); linkElement.className = 'nav-link navigation-link d-flex gap-2 justify-content-between align-items-center'; linkElement.href = LINK_URL; linkElement.setAttribute('aria-label', LINK_TEXT); const mainSpan = document.createElement('span'); mainSpan.className = 'd-flex gap-2 align-items-center text-nowrap truncate-open'; const iconContainerSpan = document.createElement('span'); iconContainerSpan.className = 'position-relative'; const iconElement = document.createElement('i'); iconElement.className = `fa fa-fw ${LINK_ICON_CLASS}`; iconElement.setAttribute('data-content', ''); const badgeClosedSpan = document.createElement('span'); badgeClosedSpan.setAttribute('component', 'navigation/count'); badgeClosedSpan.className = 'visible-closed position-absolute top-0 start-100 translate-middle badge rounded-1 bg-primary hidden'; iconContainerSpan.appendChild(iconElement); iconContainerSpan.appendChild(badgeClosedSpan); const textSpan = document.createElement('span'); textSpan.className = 'nav-text small visible-open fw-semibold text-truncate'; textSpan.textContent = LINK_TEXT; mainSpan.appendChild(iconContainerSpan); mainSpan.appendChild(textSpan); const badgeOpenSpan = document.createElement('span'); badgeOpenSpan.setAttribute('component', 'navigation/count'); badgeOpenSpan.className = 'visible-open badge rounded-1 bg-primary hidden'; linkElement.appendChild(mainSpan); linkElement.appendChild(badgeOpenSpan); listItem.appendChild(linkElement); // ---- החלק של הוספת האלמנט למיקום הנכון ---- const unsolvedTopicsAnchor = mainNav.querySelector('a[href="/unsolved"]'); if (unsolvedTopicsAnchor) { const unsolvedTopicsLi = unsolvedTopicsAnchor.closest('li'); if (unsolvedTopicsLi && unsolvedTopicsLi.nextSibling) { mainNav.insertBefore(listItem, unsolvedTopicsLi.nextSibling); } else if (unsolvedTopicsLi) { mainNav.appendChild(listItem); // אם "נושאים שלא נפתרו" הוא האחרון } else { mainNav.appendChild(listItem); // Fallback: אם ה-li לא נמצא } } else { // Fallback: אם הקישור "נושאים שלא נפתרו" לא נמצא, הוסף בסוף הרשימה mainNav.appendChild(listItem); } // ---- סוף החלק של הוספת האלמנט ---- initializeTooltip(listItem); console.log('Tampermonkey: קישור "פופולארי" נוסף לסרגל הצד.'); } } addPopularLink(); const observer = new MutationObserver(function(mutations, obs) { if (document.getElementById('main-nav') && !document.getElementById(LINK_ID)) { addPopularLink(); } }); observer.observe(document.documentElement, { childList: true, subtree: true }); })();
-
סתם, לפי מה זה מקוטלג כפופולארי?
לא לפי הצבעות בעד ולא לפי צפיות... אז מה כן?
עריכה
לפי כמות הפוסטים בשרשור, כך נראה לעניות דעתי
אבל לדעתי זה היה צריך להיות נושאים פופולארים, לא פוסטים... -
בנוסף למה שהרב @צדיק-תמים כתב,
יש גם את זה https://mitmachim.top/top
שמסודר ע"פ כמות ההצבעות של הפוסט הראשון -
@לאצי כתב בהצעת ייעול | פוסטים פופולאריים:
@צדיק-תמים איך הגעת לזה?
אני גילית בעבר את הקישור הזה
https://mitmachim.top/groupsמעניין לפרסם אינדקס - "הדפים הנסתרים בפורום"...
-
@איש-צדיק-מידי כתב בהצעת ייעול | פוסטים פופולאריים:
מעניין לפרסם אינדקס - "הדפים הנסתרים בפורום"...
אולי אחד ממנהלי הפורום יגלה לנו...
@אלישי יש מצב שפיספסנו כמה קישורים שימושיים? -
מי שמאוד מעניין אותו,
מצאתי גם את זה
https://mitmachim.top/Tags -
והנה סקריפטים לטמפרמונקי להוספת כפתורים לכל הקישורים שהוזכרו כאן.
https://mitmachim.top/top:// ==UserScript== // @name הוספת 'TOP' לסרגל הצד (מתמחים טופ) // @namespace http://tampermonkey.net/ // @version 1.0 // @description מוסיף קישור "TOP" לסרגל הצד בפורום מתמחים טופ, עם tooltip, לפני "משתמשים" // @author לאצי&AI // @match https://mitmachim.top/* // @grant none // @run-at document-idle // ==/UserScript== (function() { 'use strict'; const CONFIG = { id: 'custom-top-link-li', url: 'https://mitmachim.top/top', text: 'TOP', icon: 'fa-trophy' // אייקון גביע }; function initializeTooltip(element) { if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { new bootstrap.Tooltip(element); } else { let attempts = 0; const maxAttempts = 15; const intervalId = setInterval(() => { attempts++; if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { clearInterval(intervalId); new bootstrap.Tooltip(element); } else if (attempts >= maxAttempts) { clearInterval(intervalId); console.warn(`Tampermonkey (${CONFIG.text}): Bootstrap Tooltip function not found.`); } }, 200); } } function createNavItemElement(id, url, text, iconClass) { // ... (אותה פונקציה כמו בסקריפט הקודם - למען העצמאות, מועתקת לכאן) const listItem = document.createElement('li'); listItem.id = id; listItem.className = 'nav-item mx-2'; listItem.setAttribute('data-bs-toggle', 'tooltip'); listItem.setAttribute('data-bs-placement', 'right'); listItem.setAttribute('title', text); const linkElement = document.createElement('a'); linkElement.className = 'nav-link navigation-link d-flex gap-2 justify-content-between align-items-center'; linkElement.href = url; linkElement.setAttribute('aria-label', text); const mainSpan = document.createElement('span'); mainSpan.className = 'd-flex gap-2 align-items-center text-nowrap truncate-open'; const iconContainerSpan = document.createElement('span'); iconContainerSpan.className = 'position-relative'; const iconElement = document.createElement('i'); iconElement.className = `fa fa-fw ${iconClass}`; iconElement.setAttribute('data-content', ''); const badgeClosedSpan = document.createElement('span'); badgeClosedSpan.setAttribute('component', 'navigation/count'); badgeClosedSpan.className = 'visible-closed position-absolute top-0 start-100 translate-middle badge rounded-1 bg-primary hidden'; iconContainerSpan.appendChild(iconElement); iconContainerSpan.appendChild(badgeClosedSpan); const textSpan = document.createElement('span'); textSpan.className = 'nav-text small visible-open fw-semibold text-truncate'; textSpan.textContent = text; mainSpan.appendChild(iconContainerSpan); mainSpan.appendChild(textSpan); const badgeOpenSpan = document.createElement('span'); badgeOpenSpan.setAttribute('component', 'navigation/count'); badgeOpenSpan.className = 'visible-open badge rounded-1 bg-primary hidden'; linkElement.appendChild(mainSpan); linkElement.appendChild(badgeOpenSpan); listItem.appendChild(linkElement); return listItem; } function addTopLink() { if (document.getElementById(CONFIG.id)) { return; } const mainNav = document.getElementById('main-nav'); if (mainNav) { const listItem = createNavItemElement(CONFIG.id, CONFIG.url, CONFIG.text, CONFIG.icon); const usersAnchor = mainNav.querySelector('a[href="/users"]'); if (usersAnchor) { const usersLi = usersAnchor.closest('li'); if (usersLi) { mainNav.insertBefore(listItem, usersLi); } else { mainNav.appendChild(listItem); // Fallback } } else { mainNav.appendChild(listItem); // Fallback } initializeTooltip(listItem); console.log(`Tampermonkey: קישור "${CONFIG.text}" נוסף לסרגל הצד.`); } } addTopLink(); const observer = new MutationObserver(() => { if (document.getElementById('main-nav') && !document.getElementById(CONFIG.id)) { addTopLink(); } }); observer.observe(document.documentElement, { childList: true, subtree: true }); })();
// ==UserScript== // @name הוספת 'קבוצות' לסרגל הצד (מתמחים טופ) // @namespace http://tampermonkey.net/ // @version 1.0 // @description מוסיף קישור "קבוצות" לסרגל הצד בפורום מתמחים טופ, עם tooltip, בסוף הרשימה // @author לאצי&AI // @match https://mitmachim.top/* // @grant none // @run-at document-idle // ==/UserScript== (function() { 'use strict'; const CONFIG = { id: 'custom-groups-link-li', url: 'https://mitmachim.top/groups', text: 'קבוצות', icon: 'fa-users' }; function initializeTooltip(element) { // ... (זהה) if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { new bootstrap.Tooltip(element); } else { let attempts = 0; const maxAttempts = 15; const intervalId = setInterval(() => { attempts++; if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { clearInterval(intervalId); new bootstrap.Tooltip(element); } else if (attempts >= maxAttempts) { clearInterval(intervalId); console.warn(`Tampermonkey (${CONFIG.text}): Bootstrap Tooltip function not found.`); } }, 200); } } function createNavItemElement(id, url, text, iconClass) { // ... (זהה) const listItem = document.createElement('li'); listItem.id = id; listItem.className = 'nav-item mx-2'; listItem.setAttribute('data-bs-toggle', 'tooltip'); listItem.setAttribute('data-bs-placement', 'right'); listItem.setAttribute('title', text); const linkElement = document.createElement('a'); linkElement.className = 'nav-link navigation-link d-flex gap-2 justify-content-between align-items-center'; linkElement.href = url; linkElement.setAttribute('aria-label', text); const mainSpan = document.createElement('span'); mainSpan.className = 'd-flex gap-2 align-items-center text-nowrap truncate-open'; const iconContainerSpan = document.createElement('span'); iconContainerSpan.className = 'position-relative'; const iconElement = document.createElement('i'); iconElement.className = `fa fa-fw ${iconClass}`; iconElement.setAttribute('data-content', ''); const badgeClosedSpan = document.createElement('span'); badgeClosedSpan.setAttribute('component', 'navigation/count'); badgeClosedSpan.className = 'visible-closed position-absolute top-0 start-100 translate-middle badge rounded-1 bg-primary hidden'; iconContainerSpan.appendChild(iconElement); iconContainerSpan.appendChild(badgeClosedSpan); const textSpan = document.createElement('span'); textSpan.className = 'nav-text small visible-open fw-semibold text-truncate'; textSpan.textContent = text; mainSpan.appendChild(iconContainerSpan); mainSpan.appendChild(textSpan); const badgeOpenSpan = document.createElement('span'); badgeOpenSpan.setAttribute('component', 'navigation/count'); badgeOpenSpan.className = 'visible-open badge rounded-1 bg-primary hidden'; linkElement.appendChild(mainSpan); linkElement.appendChild(badgeOpenSpan); listItem.appendChild(linkElement); return listItem; } function addGroupsLink() { if (document.getElementById(CONFIG.id)) { return; } const mainNav = document.getElementById('main-nav'); if (mainNav) { const listItem = createNavItemElement(CONFIG.id, CONFIG.url, CONFIG.text, CONFIG.icon); mainNav.appendChild(listItem); // הוספה לסוף initializeTooltip(listItem); console.log(`Tampermonkey: קישור "${CONFIG.text}" נוסף לסרגל הצד.`); } } addGroupsLink(); const observer = new MutationObserver(() => { if (document.getElementById('main-nav') && !document.getElementById(CONFIG.id)) { addGroupsLink(); } }); observer.observe(document.documentElement, { childList: true, subtree: true }); })();
// ==UserScript== // @name הוספת 'תגיות' לסרגל הצד (מתמחים טופ) // @namespace http://tampermonkey.net/ // @version 1.0 // @description מוסיף קישור "תגיות" לסרגל הצד בפורום מתמחים טופ, עם tooltip, בסוף הרשימה // @author לאצי&AI // @match https://mitmachim.top/* // @grant none // @run-at document-idle // ==/UserScript== (function() { 'use strict'; const CONFIG = { id: 'custom-tags-link-li', url: 'https://mitmachim.top/tags', // ודא שהקישור נכון (Tags או tags) text: 'תגיות', icon: 'fa-tags' }; function initializeTooltip(element) { // ... (זהה) if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { new bootstrap.Tooltip(element); } else { let attempts = 0; const maxAttempts = 15; const intervalId = setInterval(() => { attempts++; if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { clearInterval(intervalId); new bootstrap.Tooltip(element); } else if (attempts >= maxAttempts) { clearInterval(intervalId); console.warn(`Tampermonkey (${CONFIG.text}): Bootstrap Tooltip function not found.`); } }, 200); } } function createNavItemElement(id, url, text, iconClass) { // ... (זהה) const listItem = document.createElement('li'); listItem.id = id; listItem.className = 'nav-item mx-2'; listItem.setAttribute('data-bs-toggle', 'tooltip'); listItem.setAttribute('data-bs-placement', 'right'); listItem.setAttribute('title', text); const linkElement = document.createElement('a'); linkElement.className = 'nav-link navigation-link d-flex gap-2 justify-content-between align-items-center'; linkElement.href = url; linkElement.setAttribute('aria-label', text); const mainSpan = document.createElement('span'); mainSpan.className = 'd-flex gap-2 align-items-center text-nowrap truncate-open'; const iconContainerSpan = document.createElement('span'); iconContainerSpan.className = 'position-relative'; const iconElement = document.createElement('i'); iconElement.className = `fa fa-fw ${iconClass}`; iconElement.setAttribute('data-content', ''); const badgeClosedSpan = document.createElement('span'); badgeClosedSpan.setAttribute('component', 'navigation/count'); badgeClosedSpan.className = 'visible-closed position-absolute top-0 start-100 translate-middle badge rounded-1 bg-primary hidden'; iconContainerSpan.appendChild(iconElement); iconContainerSpan.appendChild(badgeClosedSpan); const textSpan = document.createElement('span'); textSpan.className = 'nav-text small visible-open fw-semibold text-truncate'; textSpan.textContent = text; mainSpan.appendChild(iconContainerSpan); mainSpan.appendChild(textSpan); const badgeOpenSpan = document.createElement('span'); badgeOpenSpan.setAttribute('component', 'navigation/count'); badgeOpenSpan.className = 'visible-open badge rounded-1 bg-primary hidden'; linkElement.appendChild(mainSpan); linkElement.appendChild(badgeOpenSpan); listItem.appendChild(linkElement); return listItem; } function addTagsLink() { if (document.getElementById(CONFIG.id)) { return; } const mainNav = document.getElementById('main-nav'); if (mainNav) { const listItem = createNavItemElement(CONFIG.id, CONFIG.url, CONFIG.text, CONFIG.icon); mainNav.appendChild(listItem); // הוספה לסוף initializeTooltip(listItem); console.log(`Tampermonkey: קישור "${CONFIG.text}" נוסף לסרגל הצד.`); } } addTagsLink(); const observer = new MutationObserver(() => { if (document.getElementById('main-nav') && !document.getElementById(CONFIG.id)) { addTagsLink(); } }); observer.observe(document.documentElement, { childList: true, subtree: true }); })();
והנה סקריפט מאוחד לכל הארבעה (כולל 'פופולארי')
// ==UserScript== // @name הוספת קישורים מותאמים לסרגל הצד (מתמחים טופ - מאוחד) // @namespace http://tampermonkey.net/ // @version 1.0 // @description מוסיף קישורים (פופולארי, TOP, קבוצות, תגיות) לסרגל הצד בפורום מתמחים טופ // @author לאצי&AI // @match https://mitmachim.top/* // @grant none // @run-at document-idle // ==/UserScript== (function() { 'use strict'; // --- פונקציות עזר משותפות --- function initializeTooltip(element, linkText) { if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { new bootstrap.Tooltip(element); } else { let attempts = 0; const maxAttempts = 15; const intervalId = setInterval(() => { attempts++; if (typeof bootstrap !== 'undefined' && typeof bootstrap.Tooltip === 'function') { clearInterval(intervalId); new bootstrap.Tooltip(element); } else if (attempts >= maxAttempts) { clearInterval(intervalId); console.warn(`Tampermonkey (${linkText}): Bootstrap Tooltip function not found.`); } }, 200); } } function createNavItemElement(id, url, text, iconClass) { const listItem = document.createElement('li'); listItem.id = id; listItem.className = 'nav-item mx-2'; listItem.setAttribute('data-bs-toggle', 'tooltip'); listItem.setAttribute('data-bs-placement', 'right'); listItem.setAttribute('title', text); const linkElement = document.createElement('a'); linkElement.className = 'nav-link navigation-link d-flex gap-2 justify-content-between align-items-center'; linkElement.href = url; linkElement.setAttribute('aria-label', text); const mainSpan = document.createElement('span'); mainSpan.className = 'd-flex gap-2 align-items-center text-nowrap truncate-open'; const iconContainerSpan = document.createElement('span'); iconContainerSpan.className = 'position-relative'; const iconElement = document.createElement('i'); iconElement.className = `fa fa-fw ${iconClass}`; iconElement.setAttribute('data-content', ''); const badgeClosedSpan = document.createElement('span'); badgeClosedSpan.setAttribute('component', 'navigation/count'); badgeClosedSpan.className = 'visible-closed position-absolute top-0 start-100 translate-middle badge rounded-1 bg-primary hidden'; iconContainerSpan.appendChild(iconElement); iconContainerSpan.appendChild(badgeClosedSpan); const textSpan = document.createElement('span'); textSpan.className = 'nav-text small visible-open fw-semibold text-truncate'; textSpan.textContent = text; mainSpan.appendChild(iconContainerSpan); mainSpan.appendChild(textSpan); const badgeOpenSpan = document.createElement('span'); badgeOpenSpan.setAttribute('component', 'navigation/count'); badgeOpenSpan.className = 'visible-open badge rounded-1 bg-primary hidden'; linkElement.appendChild(mainSpan); linkElement.appendChild(badgeOpenSpan); listItem.appendChild(linkElement); return listItem; } // --- הגדרות הקישורים --- const LINKS_CONFIG = [ { id: 'custom-top-link-li', url: 'https://mitmachim.top/top', text: 'TOP', icon: 'fa-trophy', placement: (mainNav, listItem) => { const usersAnchor = mainNav.querySelector('a[href="/users"]'); if (usersAnchor) { const usersLi = usersAnchor.closest('li'); if (usersLi) { mainNav.insertBefore(listItem, usersLi); } else { mainNav.appendChild(listItem); } } else { mainNav.appendChild(listItem); } } }, { id: 'custom-popular-link-li', url: 'https://mitmachim.top/popular', text: 'פופולארי', icon: 'fa-fire', placement: (mainNav, listItem) => { const unsolvedTopicsAnchor = mainNav.querySelector('a[href="/unsolved"]'); if (unsolvedTopicsAnchor) { const unsolvedTopicsLi = unsolvedTopicsAnchor.closest('li'); if (unsolvedTopicsLi && unsolvedTopicsLi.nextSibling) { mainNav.insertBefore(listItem, unsolvedTopicsLi.nextSibling); } else if (unsolvedTopicsLi) { mainNav.appendChild(listItem); } else { mainNav.appendChild(listItem); } } else { mainNav.appendChild(listItem); } } }, { id: 'custom-groups-link-li', url: 'https://mitmachim.top/groups', text: 'קבוצות', icon: 'fa-users', placement: (mainNav, listItem) => { mainNav.appendChild(listItem); } }, { id: 'custom-tags-link-li', url: 'https://mitmachim.top/tags', // ודא קישור נכון text: 'תגיות', icon: 'fa-tags', placement: (mainNav, listItem) => { mainNav.appendChild(listItem); } } ]; // --- פונקציה ראשית להוספת כל הקישורים --- function addAllCustomLinks() { const mainNav = document.getElementById('main-nav'); if (!mainNav) return; LINKS_CONFIG.forEach(config => { if (document.getElementById(config.id)) { return; // דלג אם הקישור כבר קיים } const listItem = createNavItemElement(config.id, config.url, config.text, config.icon); config.placement(mainNav, listItem); // השתמש בפונקציית המיקום הספציפית initializeTooltip(listItem, config.text); console.log(`Tampermonkey: קישור "${config.text}" נוסף לסרגל הצד.`); }); } // --- הרצה ו-MutationObserver --- addAllCustomLinks(); // נסה להוסיף מיד const observer = new MutationObserver((mutationsList, obs) => { // בודק אם main-nav קיים, ומוסיף אם יש צורך // כדי למנוע קריאות מרובות מידי, אפשר להוסיף בדיקה אם כל הקישורים כבר נוספו let allAdded = LINKS_CONFIG.every(config => document.getElementById(config.id)); if (document.getElementById('main-nav') && !allAdded) { addAllCustomLinks(); } // אם כל הקישורים נוספו, אפשר לשקול לנתק את ה-observer // if (allAdded) { // obs.disconnect(); // console.log("Tampermonkey: All custom links added, observer disconnected."); // } }); observer.observe(document.documentElement, { childList: true, subtree: true }); })();
קרדיט: AI כמובן...
וכך נראה עכשיו הסרגל שלי במתמחים...