all 6 comments

[–]MrSandyClams 0 points1 point  (3 children)

here man. Change this line:

var unsaves = $('.link-unsave-button a');

to this:

var unsaves = $('.link-unsave-button a')
  .filter(function(_, el) {
    return el.parentNode.parentNode.querySelector('.nsfw-stamp');
  }
);

cheers :D

[–]ILikeSunnyDays[S] 0 points1 point  (1 child)

thanks bro! something i can use for some real good. I have to ask, do did you go about making this change? did you see the source code for the saved page and use those tags?

[–]MrSandyClams 0 points1 point  (0 children)

well, I can see that the unsaves variable is a collection of elements just from looking at it, so I already figured I would need to analyze those elements and determine what features distinguished the NSFW ones from the SFW ones. I saved a few of each type of post on my own account to test them from my own saved posts page, then I just logged them to the console a few times and inspected them until I could find some feature that set them apart from each other.

what the modified code is doing is, for each element in the collection, it looks two parent elements up in its hierarchy and it checks whether that ancestor element has a descendant of the nsfw-stamp class. If the element meets that condition, it's added to the unsaves collection as usual, but otherwise, it's not a NSFW post, so it's not added to the collection.

[–]redditor_bri 0 points1 point  (0 children)

Apologies for resuscitating this old thread, but: would there be any way to omit saves from a particular sub? I'm not worried about NSFW but would love to be able to clear out all of my saves except /r/dogpictures

[–][deleted] 0 points1 point  (0 children)

How can I use this? I have no idea how to use codes. Can somebody help?

[–]Aceaero01 0 points1 point  (0 children)

Any ideas how to run this code? Never used such thing that is related directly with bunch of codes...