Github index filter

filter your repo star/fork information

2018-07-26 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Github index filter
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  filter your repo star/fork information
// @author       https://github.com/iMeiji
// @match       https://github.com/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

// enter your GitHub username
const yourGitHubUserName = "iMeiji";

(function () {
    'use strict';
    var regex = `^\\/(${yourGitHubUserName})\\/([^\\s]*)`;

    const observer = new MutationObserver(main);
    let article = document.body;

    let options = {
        'subtree': true,
        'attributes': true
    };

    observer.observe(article, options);

    function remove(startList, root) {
        let removeArr = [];
        for (let fork of startList) {
            let list = fork.getElementsByClassName("f4 lh-condensed text-bold text-gray-dark");
            let a = list.item(0).getElementsByTagName("a");
            let h = a.item(0).getAttribute("href");
            if (h.search(new RegExp(regex)) !== -1) {
                console.log(h);
                removeArr.push(fork);
            }
        }
        removeArr.map((value) => {
            value.parentNode.removeChild(value);
        });
    }

    function main() {
        let root = document.getElementsByClassName("news");
        let forkList = root.item(0).getElementsByClassName("fork");
        let startList = root.item(0).getElementsByClassName("watch_started");
        remove(forkList, root);
        remove(startList, root);
    }
})();