Skip to content

Instantly share code, notes, and snippets.

@trickster
Forked from surprisetalk/hn-gpt-free.js
Created March 23, 2023 13:48
Show Gist options
  • Save trickster/4efe8629f886186dac5b37c553374b08 to your computer and use it in GitHub Desktop.
Save trickster/4efe8629f886186dac5b37c553374b08 to your computer and use it in GitHub Desktop.
Userscript to hide any HackerNews story with "GPT" in its title.
// ==UserScript==
// @name HackerNews GPT-Free Feed
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hides any Hacker News story with "GPT" in its title.
// @author Taylor Troesh
// @include https://news.ycombinator.com/*
// @grant none
// ==/UserScript==
[...document.getElementsByClassName("athing")].forEach(function(x) {
if(x.getElementsByClassName("titleline")[0].innerText.match(/gpt/i)) {
x.hidden = true;
x.nextElementSibling.hidden = true;
x.nextElementSibling.nextElementSibling = true;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment