Skip to content

Instantly share code, notes, and snippets.

@breyten
Last active December 31, 2015 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save breyten/8038178 to your computer and use it in GitHub Desktop.
Save breyten/8038178 to your computer and use it in GitHub Desktop.
Hide Bitcoin articlens on HN with TamperMonkey
// ==UserScript==
// @name HNBitcoinHider
// @namespace http://yerb.net/
// @version 0.1
// @description Hide bitcoin news items on Hacker News
// @match https://news.ycombinator.com*
// @copyright 2013, Breyten Ernsting
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
var titles = new Array();
var elements = $('td.title');
elements.each(function() {
titles.push($(this));
});
var patt = /bitcoin/i;
$.each(titles, function(index, title_elem) {
if (patt.test($(title_elem).text())) {
$(title_elem).parent().hide();
$(title_elem).parent().next().hide();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment