Last active
September 27, 2020 20:49
-
-
Save gene1wood/74a0383a8ec145131144 to your computer and use it in GitHub Desktop.
Greasemonkey User Script to hide sponsored posts on boingboing.net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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() |
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
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!