Tutsplus

Hide readed article

2017-06-04 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

// ==UserScript==
// @name     Tutsplus
// @version	1.2
// @description Hide readed article
// @include    https://tutsplus.com*
// @include    http://tutsplus.com* 
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js
// @namespace https://greasyfork.org/users/38384
// ==/UserScript==
alert("aa");
 jQuery(function() {

    jQuery.ajaxPrefilter( function (options) {
      if (options.crossDomain && jQuery.support.cors) {
        var http = (window.location.protocol === 'http:' ? 'http:' : 'https:');
        options.url = http + '//cors-anywhere.herokuapp.com/' + options.url;
      }
    });
    
    jQuery.get('http://www.mycodemyway.in/txt/tutsplus_code.txt', function (response) {
        var res = response.split(",");
        var resLength = res.length, pageSize = 0;
  debugger;
        for (var i=0; i<resLength; i++) {
            jQuery("a.posts__post-preview").each(function () {
                if (pageSize == 12) {
                   return false;
                }
                var href = jQuery(this).prop('href');
                if (href.indexOf(res[i]) != -1) {
                    jQuery(this).parents("li").hide();
                    pageSize = pageSize + 1; 
                }
            });
       }
    });
});