Skip to content

Commit e938d4b

Browse files
committed
fix
1 parent 515cb97 commit e938d4b

1 file changed

Lines changed: 39 additions & 5 deletions

File tree

Greasyfork Search with Sleazyfork Results include/Greasyfork Search with Sleazyfork Results include.user.js

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @name:zh-TW 大人的Greasyfork
55
// @name:ja 大人のGreasyfork
66
// @namespace hoothin
7-
// @version 0.61
7+
// @version 0.63
88
// @description Merge adult results of sleazyfork into greasyfork when the script is no longer anonymously available, add rating score and version for scripts then
99
// @description:zh-CN 在Greasyfork的搜索结果中添加Sleazyfork上的成人脚本,增加评分与版本号,并在访问匿名不可用脚本时跳转至Sleazyfork
1010
// @description:zh-TW 在Greasyfork的搜索結果中添加Sleazyfork上的成人腳本,增加評分與版本號,並在訪問匿名不可用腳本時跳轉至Sleazyfork
@@ -15,6 +15,8 @@
1515
// @include http*://sleazyfork.org/*
1616
// @include http*://www.sleazyfork.org/*
1717
// @grant GM_xmlhttpRequest
18+
// @grant GM_setValue
19+
// @grant GM_getValue
1820
// @connect greasyfork.org
1921
// @connect sleazyfork.org
2022
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=rixixi@sina.com&item_name=Greasy+Fork+donation
@@ -88,9 +90,41 @@
8890
}
8991
if(description)description.innerHTML+="<strong>Ver."+script.getAttribute("data-script-version")+"</strong>";
9092
}
91-
var scripts=document.querySelectorAll('ol.script-list>li');
92-
for(let i=0;i<scripts.length;i++){
93-
let script=scripts[i];
94-
addScore(script);
93+
var sortDiv=document.querySelector("#script-list-sort");
94+
if(sortDiv){
95+
var scripts=document.querySelectorAll('ol.script-list>li');
96+
for(let i=0;i<scripts.length;i++){
97+
let script=scripts[i];
98+
addScore(script);
99+
}
100+
//Modify from GreasyFork Bullshit Filter,Thanks to darkred
101+
var style = document.createElement('style');
102+
style.textContent = 'li.filtered { display:none !important; }';
103+
style.type = 'text/css';
104+
document.querySelector('head').appendChild(style);
105+
var bullshit="百度(云|网盘)|AntiGame|split|Agar|agar\.io|alis\.io|angel\.io|ExtencionRipXChetoMalo|AposBot|DFxLite|ZTx-Lite|AposFeedingBot|AposLoader|Blah Blah|Orc Clan Script|Astro\s*Empires|^\s*Attack|^\s*Battle|BiteFight|Blood\s*Wars|Bots|Bots4|Brawler|\bBvS\b|Business\s*Tycoon|Castle\s*Age|City\s*Ville|chopcoin\.io|Comunio|Conquer\s*Club|CosmoPulse|cursors\.io|Dark\s*Orbit|Dead\s*Frontier|Diep\.io|\bDOA\b|doblons\.io|DotD|Dossergame|Dragons\s*of\s*Atlantis|driftin\.io|Dugout|\bDS[a-z]+\n|elites\.io|Empire\s*Board|eRep(ublik)?|Epic.*War|ExoPlanet|Falcon Tools|Feuerwache|Farming|FarmVille|Fightinfo|Frontier\s*Ville|Ghost\s*Trapper|Gladiatus|Goalline|Gondal|gota\.io|Grepolis|Hobopolis|\bhwm(\b|_)|Ikariam|\bIT2\b|Jellyneo|Kapi\s*Hospital|Kings\s*Age|Kingdoms?\s*of|knastv(ö|oe)gel|Knight\s*Fight|\b(Power)?KoC(Atta?ck)?\b|\bKOL\b|Kongregate|Last\s*Emperor|Legends?\s*of|Light\s*Rising|lite\.ext\.io|Lockerz|\bLoU\b|Mafia\s*(Wars|Mofo)|Menelgame|Mob\s*Wars|Mouse\s*Hunt|Molehill\s*Empire|NeoQuest|MyFreeFarm|narwhale\.io|Neopets|Nemexia|\bOGame\b|Ogar(io)?|Pardus|Pennergame|Pigskin\s*Empire|PlayerScripts|pokeradar\.io|Popmundo|Po?we?r\s*(Bot|Tools)|PsicoTSI|Ravenwood|Schulterglatze|slither\.io|slitherplus\.io|slitheriogameplay|SpaceWars|splix\.io|\bSW_[a-z]+\n|\bSnP\b|The\s*Crims|The\s*West|torto\.io|Travian|Treasure\s*Isl(and|e)|Tribal\s*Wars|TW.?PRO|Vampire\s*Wars|vertix\.io|War\s*of\s*Ninja|West\s*Wars|wings\.io|\bWoD\b|World\s*of\s*Dungeons|wtf\s*battles|Wurzelimperium";
106+
var filter=function(){
107+
[].forEach.call(document.querySelectorAll('article>h2'), function(item) {
108+
if(new RegExp(bullshit,"i").test(item.innerText))
109+
item.parentNode.parentNode.classList.add('filtered');
110+
});
111+
};
112+
var switchFilter=document.createElement("div"),enableFilter=!GM_getValue("disableFilter");
113+
switchFilter.innerHTML='<input type="checkBox" name="switchFilter" id="switchFilter"/><label for="switchFilter">Enable Filter</label>';
114+
var switchFilterCheckbox=switchFilter.querySelector('#switchFilter');
115+
switchFilterCheckbox.checked=enableFilter;
116+
switchFilterCheckbox.onclick=function(){
117+
if(enableFilter){
118+
[].forEach.call(document.querySelectorAll('li.filtered'), function(item) {
119+
item.classList.remove('filtered');
120+
});
121+
}else{
122+
filter();
123+
}
124+
GM_setValue("disableFilter",enableFilter);
125+
enableFilter=!enableFilter;
126+
};
127+
if(enableFilter)filter();
128+
sortDiv.insertBefore(switchFilter,sortDiv.firstChild);
95129
}
96130
})();

0 commit comments

Comments
 (0)