Greasy Fork is available in English.

Hide That Thread

Hide a particular thread from Ask Metafilter's list.

  1. // ==UserScript==
  2. // @name Hide That Thread
  3. // @namespace http://example.com/hide_that_thread
  4. // @description Hide a particular thread from Ask Metafilter's list.
  5. // @include http://ask.metafilter.com/*
  6. // @version 0.0.1.20140524193917
  7. // ==/UserScript==
  8.  
  9. var thatPostSnap = document.evaluate(
  10. "//div[contains(concat(' ', @class, ' '), ' post ')]/" +
  11. "span[contains(concat(' ', @class, ' '), ' smallcopy ')]/" +
  12. "a[starts-with(@href, '/212479')]",
  13. document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  14.  
  15. for (var i = 0; i < thatPostSnap.snapshotLength; i++) {
  16. var thatPost = thatPostSnap.snapshotItem(i);
  17. if (thatPost == null) {
  18. continue;
  19. }
  20. thatPost = thatPost.parentNode;
  21. if (thatPost == null) {
  22. continue;
  23. }
  24. thatPost = thatPost.parentNode;
  25. if (thatPost == null) {
  26. continue;
  27. }
  28. thatPostsParent = thatPost.parentNode;
  29. if (thatPostsParent == null) {
  30. continue;
  31. }
  32. thatPostsParent.removeChild(thatPost);
  33. }
  34.