Undiscovered Trending

Hide starred repos in trending and remove glob

اعتبارا من 28-02-2025. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name        Undiscovered Trending
// @namespace   shiftgeist
// @icon	https://github.com/fluidicon.png
// @match       https://github.com/trending*
// @grant       none
// @version     20250228
// @author      shiftgeist
// @description Hide starred repos in trending and remove glob
// @license     GNU GPLv3
// ==/UserScript==

function log(...params) {
  if (localStorage.getItem('undiscovered-debug') === 'true') {
    console.log('[undiscovered]', ...params)
  }
}

function main() {
  log('start of main')

  setTimeout(() => {
    log('delay done')

    const articles = document.querySelectorAll('article')

    for (article of articles) {
      if (
        // Already starred
        article.querySelector('.starred-button-icon').getClientRects().length > 0 ||
        // Contains AI
        ['llm', 'ollama', 'openai', 'crypto'].findIndex(e =>
          article.innerText.toLowerCase().includes(e)
        ) >= 0
      ) {
        article.style.display = 'none'
      }
    }
  }, 300)
}

log('init')

let previousUrl = '';
const observer = new MutationObserver(function(mutations) {
  if (location.href !== previousUrl) {
      previousUrl = location.href
      main()
    }
});
const config = {subtree: true, childList: true};
observer.observe(document, config);