70 points · by eat_veggies · 8y ago · 38 comments
// ==UserScript==
// @name Hacker News VIP highlighter
// @version 1
// @grant none
// @match https://news.ycombinator.com/*
// ==/UserScript==
function highlightVIPs() {
'use strict';
const VIPs = [
"WalterBright"
];
const userTags = Array.from(document.getElementsByClassName("hnuser"));
userTags.forEach(tag => {
const username = tag.href.split("=")[1];
if (VIPs.includes(username)) {
tag.style.fontWeight = 'bold';
}
});
}
highlightVIPs();
(I'm not much of a JavaScript programmer, but it seems to work.)https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
This example is great, as it is open source and supports Firefox too. Maybe I'll do both browsers as well! This HN friends extension does most if not all of the primitive things that I will need to do, so I'm being sincere and I think it's a great publish.
I was meaning to write my own userscript / chrome extension to show a button if there's a reddit-thread with same URL trending in hackernews, so you can click and go to those comments. It would say how many comments there are, and pull up the one with the most upvotes/comments within a 6 month timespan.
Haven't gotten around to it yet unless someone else wants to make it
I made one for my favorite notetaking app though, that I use fairly often. I made a write up of things I learned to write it
http://vincentmtang.com/2018/06/29/adventures-in-writing-a-t...
[0] https://github.com/etcet/HNES
[1] https://addons.mozilla.org/en-US/firefox/addon/hnes/
[2] https://chrome.google.com/webstore/detail/bappiabcodbpphnojd...
a.hnuser[href*="id=dewey"] { background-color: orange !important; color: white !important; }