SmashingMagazine

Hide readed article

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name     SmashingMagazine
// @description Hide readed article
// @include    http://www.smashingmagazine.com/*
// @include    https://www.smashingmagazine.com/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js
// @version 0.0.1.20181112100255
// @namespace https://greasyfork.org/users/38384
// ==/UserScript==

jQuery(function() {
        var response = ["/2018/10/"];
        var resLength = response.length, pageSize = 0;
        debugger;
        for (var i=0; i<resLength; i++) {
            jQuery("h1.article--post__title a").each(function () {
                if (pageSize == 10) {
                   return false;
                }
                var href = jQuery(this).prop('href');
                if (href.indexOf(response[i]) != -1) {
                    jQuery(this).closest("article").hide();
                    pageSize = pageSize + 1; 
                }
            });
       }
});