Skip to content

Instantly share code, notes, and snippets.

@gene1wood
Last active September 27, 2020 20:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gene1wood/74a0383a8ec145131144 to your computer and use it in GitHub Desktop.
Save gene1wood/74a0383a8ec145131144 to your computer and use it in GitHub Desktop.
Greasemonkey User Script to hide sponsored posts on boingboing.net
// ==UserScript==
// @name Block Boing Boing Ads
// @namespace http://cs.cementhorizon.com
// @description Block Boing Boing Ads
// @include http://boingboing.net/*
// @include https://boingboing.net/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @version 5
// @grant none
// ==/UserScript==
$("div.fromtheshop").hide()
$("div#widgets div.widget_stackcommerce_widget").hide()
// Note the leading space in the href which looks like a typo in the boingboing code
$("article div a.category[href=' https://boingboing.net/tag/sponsored']").parent().parent().hide()
// $("div h2 a.byline[href='https://boingboing.net/author/ruben_bolling']").parent().parent().hide()
// $("div h2 a.byline[href='https://boingboing.net/author/wimpyrutherford']").parent().parent().hide()
// $("div h2 a.byline[href='https://boingboing.net/author/boingboingstore']").parent().parent().hide()
//
// $("article a.byline[href='https://boingboing.net/author/boingboingstore']").parent().parent().hide()
// $("article a.byline[href='https://boingboing.net/author/wimpyrutherford']").parent().parent().hide()
// $("article a.byline[href='https://boingboing.net/author/ruben_bolling']").parent().parent().hide()
// $("article a.byline[href='https://boingboing.net/author/petersheridan']").parent().parent().hide()
$("a.byline[href='https://boingboing.net/author/petersheridan']").parent().parent().hide()
$("a.byline[href='https://boingboing.net/author/boingboingstore']").parent().parent().hide()
$("a.byline[href='https://boingboing.net/author/wimpyrutherford']").parent().parent().hide()
$("a.byline[href='https://boingboing.net/author/ruben_bolling']").parent().parent().hide()
$("a.byline[href='https://boingboing.net/author/sponsoredpost']").parent().parent().hide()
@omems
Copy link

omems commented Dec 10, 2015

Edit: I figured it out. For anyone interested, it's like this:
$("a[href='http://boingboing.net/author/advertisement']").parent().parent().hide()
or if you want to skip specific stories based on their title:
$("div h1 a:contains('Trump')").parent().parent().hide()

Hi,
Nice work.
I use typically browse via boingboing.net/blog to get around some of the formatting I dislike, and I can't get this script to work there--I'm still seeing stuff from author/boingboing (which usually is Store stuff). Any idea how to eliminate them by modifying your script?
Thanks!

@gene1wood
Copy link
Author

Great suggestion, I didn't know about /blog. I've added the filters for that page as well (though in a slightly different way than you suggest, just to be more targeted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment