// ==UserScript== // @name dblp filter // @namespace http://tampermonkey.net/ // @version 1.0.0 // @license MIT // @description Filtering dblp result with including keywords and excluding keywords. // @author Laurentiusia // @match https://dblp.org/* // @icon https://www.google.com/s2/favicons?sz=64&domain=dblp.org // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Your code here... function handleSubmit(){ var input1 = $('#textbox1').val(); var input2 = $('#textbox2').val(); $(".entry").each(function (index, item){ $(item).show() }) include_with(input1) exclude_with(input2) } function exclude_with(keywords){ if (keywords === ""){ return } keywords.split(';').forEach(function (keyword){ $(".entry").each(function (index, item){ var text = $(item).find("cite").find(".title").text() if (text.toLowerCase().includes(keyword.toLowerCase())) { $(item).hide() } }) }) } function include_with(keywords){ if (keywords === ""){ return } keywords.split(';').forEach(function (keyword){ $(".entry").each(function (index, item){ var text = $(item).find("cite").find(".title").text() if (!text.toLowerCase().includes(keyword.toLowerCase())) { $(item).hide() } } ) }) } $(".publ-list").ready(function () { var $container = $('
') .attr('id', 'fixed-container') .css({ position: 'fixed', right: '10px', top: '50%', transform: 'translateY(-50%)', width: '200px', padding: '10px', backgroundColor: '#f9f9f9', boxShadow: '0px 0px 10px rgba(0, 0, 0, 0.1)', border: '1px solid #ccc', borderRadius: '5px', textAlign: 'center' }); var $textbox1 = $('