您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
当前为
// ==UserScript== // @name Cdiscount 40% noel filter // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author Syntaxlb // @match http://www.cdiscount.com/* // @grant none // ==/UserScript== // CRTL+Q for execute the script (function() { 'use strict'; var listP = $('<div></div>').attr('id', 'listP'); listP.insertBefore($('#lpBloc')); var totalPage = $('#pager #PaginationForm_TotalPage').attr('value'); totalPage = parseInt(totalPage); var currentPage = 1; var countNoDiscount = 0; function filterDiscount() { var hasDiscount = false; $('#lpBloc li .prdtBloc').each(function() { var el = $(this); var opImg = $(this).find('.opImg img'); if (opImg) { if (opImg.attr('alt') == "Noel jusqu'à 40% remboursés") { hasDiscount = true; el.attr('style', 'width:300px; float: left;'); el.appendTo(listP); } } }); if (hasDiscount == false) { countNoDiscount++; } } function clickPage() { setTimeout(function () { currentPage++; if (currentPage <= totalPage) { console.log('CLICK PAGE ' + currentPage); $('#pager a.pgNext').click(); clickPage(); } filterDiscount(); }, 6000); } function doFilterDiscount() { setTimeout(function () { filterDiscount(); if (countNoDiscount < 70) { doFilterDiscount(); } else { console.log('STOP FILTER DISCOUNT'); } }, 1000); } $(window).keypress(function(event) { if (!(event.which == 17 && event.ctrlKey)) return true; alert('Démarrage du filtre 40% noel'); clickPage(); doFilterDiscount(); }); })();