![]() ![]() |
*NSFW* http://www.reddit.com/r/gonewild/ I'm looking for a way to remove all the men who post in this section. They are supposed to use: [M] or [Male] but many use male, m, etc. Thanks for any help, |
![]() ![]() |
Wow, haha what a request. Remove entries which have, (m) <m> [m] ' m ' or 'male' anywhere in the title.
// ==UserScript==
// @name Remove Males From Reddit
// @include http://www.reddit.com/r/gonewild*
// ==/UserScript==
var s = document.evaluate("//a[@class='title ']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for (i=0;i<s.snapshotLength;i++) {
if (s.snapshotItem(i).textContent.match((/(\[m\]|<m>|[\s]+m[\s]+|\(m\)|cock|male)/i))) {
s.snapshotItem(i).parentNode.parentNode.parentNode.style.display = 'none';
}
}
</m>
|
![]() ![]() |
@kooks: I've not even checked the link, but that would also match if (s.snapshotItem(i).textContent.match((/(\[m\]|<m>|[\s]+m[\s]+|\(m\)|cock|male)/i))) ..to.. if (/\[m\]|<m>|\s+m\s+|\(m\)|cock|[^(fe)]male/i.test(s.snapshotItem(i).textContent)) |
![]() ![]() |
thanks for the help to the both of you, but after trying both versions there are still quite a few male submissions making it through. the ones that did have the following: [male]
thanks. |
![]() ![]() |
I've just tried it using my snippet and it works fine for me... var s = document.evaluate("//a[@class='title ']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for (i=0;i<s.snapshotLength;i++) {
if (/\[m\]|<m>|\s+m\s+|\(m\)|cock|[^(fe)]male/i.test(s.snapshotItem(i).textContent)) {
s.snapshotItem(i).parentNode.parentNode.parentNode.style.display = 'none';
}
}
|
![]() ![]() |
thanks for the help znerp. I'm using Grease Fire so I right clicked the monkey in the bottom right and went to new user script, went through the motions. Copy & pasted your script, and made sure it was enabled. however, those submissions are still getting through. however, if it's working on your end I'm screwing something up. Just gotta trouble shoot. |
![]() ![]() |
Ok, I see what you did; you're trying it logged in whilst we're not. I've just used BugMeNot to get in, and to fix it just change the first line to this... var s = document.evaluate("//a[starts-with(@class,'title ')]",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
|
![]() ![]() |
znerp: mad props. works like a charm. can this be posted some how for greasefire to pick up? there are a ton of gone wild users who would love to have this :) thanks again, |
![]() ![]() |
If you upload it as a script (assuming kooks is alright with that), it should show up in the Greasefire thing. I'd do it myself but I really don't want any angry horny users to complain at me if/when it breaks. |
![]() ![]() |
znerp wrote: ROFL!!! |
![]() ![]() |
Hahaha, thanks znerp for that fix, I need to work on my regex. Bob Loblaw feel free to do what you want with it. |


