
Show HN: Extension to highlight and tag users on Hacker News - eat_veggies
https://github.com/veggiedefender/hn-friends
======
insertnickname
Funny, I just made something like this today (but more primitive), mostly so
that I won't miss Walter Bright's 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.)

~~~
eat_veggies
Pretty cool! If you want to speed your script up, consider implementing VIPs
as a Set() so lookups are approx. O(1) rather than O(n).

[https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Set)

~~~
jessaustin
Probably won't see much speedup with _one_ VIP? b^)

~~~
JasonFruit
What exactly is the b^) face? Smily staring cyclops? If it's an emotion, it
escapes me.

~~~
whatsstolat
Looks like a side profile, with glasses

~~~
wingerlang
Could be a misspelled B^) which looks more like a smiley with a nose.

[http://symbolhound.com/?q=b%5E%29](http://symbolhound.com/?q=b%5E%29)

~~~
JasonFruit
That seems possible. I'm not so up on my smileys as I might be.

------
peterwwillis
I'd like an extension to remove usernames entirely. I would rather my opinions
about commentary be less biased, not more.

~~~
eat_veggies
in that case, just add .hnuser to your ad-blocking rules.

------
trishume
If you're the kind of person who wants this, you may also be interested in my
RSS feed of good HN commenters:
[http://hnblogs.thume.net/](http://hnblogs.thume.net/)

~~~
Promarged
[http://hnblogs.thume.net/feed.xml](http://hnblogs.thume.net/feed.xml) returns
500 for me :(

------
sbjs
Very cool! I think it's especially great that this is a browser plugin instead
of a separate website. It's great when developers make things as easy as
possible on users. Nice job, I'll be giving it a try!

~~~
yebyen
Agree! I am an app developer, and I like to think about how to make app
developers jobs (and onboarding) easier, and the next thing I will write on
that vein I think, already decided with the idea and design mostly formulated,
will be a Chrome extension (for Pivotal Tracker users that also connect
Bitbucket to a CI, to aid in merge request management)

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.

~~~
eat_veggies
Luckily, both Chrome and Firefox use the webextensions API, so supporting both
is pretty simple.

------
yebyen
This is super! I was able to understand how to use it right away, installed
and upvoted. I don't know how much I will use it, but I have often noticed the
same insightful people popping up in discussions I am interested in, and so I
will get some value out of it, and I guess I love the logo, too.

------
mikkergp
I have noticed that sites like reddit and HN feel implicitly anonymous. it'd
be interesting to see how this helps reduce some of that. I've been trying my
own ways of improving how I interact with people on reddit, maybe I'll try
this.

------
keithnz
added it to my slowly growing list of HN ( and related ) resources
[https://github.com/keithn/HackerNewsCommunity](https://github.com/keithn/HackerNewsCommunity)

------
Kagerjay
this is just like reddit RES that's pretty cool

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...](http://vincentmtang.com/2018/06/29/adventures-in-writing-a-
tampermonkey-script-extension/)

~~~
humblebee
There is actually a HNES[0] with both firefox[1] and chrome[2] support. I use
it primarily because it highlights new comments from the last time I visited a
submission.

[0] [https://github.com/etcet/HNES](https://github.com/etcet/HNES)

[1] [https://addons.mozilla.org/en-
US/firefox/addon/hnes/](https://addons.mozilla.org/en-US/firefox/addon/hnes/)

[2]
[https://chrome.google.com/webstore/detail/bappiabcodbpphnojd...](https://chrome.google.com/webstore/detail/bappiabcodbpphnojdiaddhnilfnjmpm)

------
gnicholas
Would be neat if you could tag people with different colors, to indicate
like/dislike, or to indicate the primary topic that you have encountered them
talking about in the past.

~~~
b_b
I would think that would be generally harmful for the point of thoughtful
discussion as you are essentially labeling a person from the get-go with a
certain bias.

~~~
gnicholas
I think it could actually have the opposite effect — that someone you've
tagged at one point as someone you disagree with later posts something that
you agree with (or vice versa).

~~~
genericid
More pessimistically, it could make you disagree posts because they're made by
someone you disagree with.

------
dewey
Seems useful, does anyone know of a similar thing for Safari or as a
userscript that works in Tampermonkey (across all browsers) or Stylish?

~~~
ChrisGranger
With Stylish or similar, you can do the username highlight like so:

a.hnuser[href*="id=dewey"] { background-color: orange !important; color: white
!important; }

------
tomkinson
Love it. Thanks. Even better if tag is visible btw.

~~~
eat_veggies
I'll work on it!

~~~
sbjs
Also I would personally prefer for the "tag" box to have a save button next to
it. It wasn't clear to me whether it autosaves or if I was supposed to type
the name before clicking "add friend". Could just be me though, but I would
like this feature. Added this issue so that if people agree or disagree, they
can vote on it through thumbs up/down in the Github interface:
[https://github.com/veggiedefender/hn-
friends/issues/1](https://github.com/veggiedefender/hn-friends/issues/1)

