Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: HN Chat – Minimal Hacker News Chat with User Verification (hnchat.com)
180 points by zaytoun on Sept 5, 2016 | hide | past | favorite | 80 comments



Idea: Color each username based on a hash of the username.

    '#' + username.md5().take(6).join('')
I did it for a chat I once built, users liked it, and it helps you keep track of who said what. Though I added some styling to keep it legible, like a 30% white blend, a stroke, and a drop shadow.

https://dl.dropboxusercontent.com/spa/quq37nq1583x0lf/xf17fn... (not the best example since everyone happened to be shades of green)


I do something similar but different..

I take a long sequence of random numbers, using only digits 1-8, like

      29834572498741387972573179875938893507418675309
Let's say that goes on for 105 places. Each user then gets an auto-increment ID that I mod 100 (divide by 100 and take the remainder) and add one. I start at that index of the long sequence of digits, and take six characters. If your ID was 112, mod 100 would be 12, plus 1 is 13. Starting at the 13th character, I take six characters: 413879. Then prefix with # - #413879 - and you have a pseudo-random hex code, with neighboring colors being pleasantly visually related.

If it's a dark background, I use letters A-F instead.

If the contrast is insufficient, I'll change a character in the sequence here and there, but it's a lot faster than calculating a new color for everyone, and while everyone doesn't get a unique color, my opinion is that color isn't what makes them unique, it's their username; the color is an extra hint for those able to see it.

EDIT: I called this, when I came up with it a very long time ago, the "sliding doors" technique. I'm sure I'm not the first to do something like that, and it was before the similarly named (abut unrelated, functionally) image replacement trick was popular.


I like the idea, although I'd probably choose a palette of, say, 30 colors, and hash the username mod 30 to determine the color. That way all the colors should be sufficiently contrasty.


My IRC client does this, but I find it too jarring when multiple people are talking and they have the same color.

Sometimes it rolls a yahtzee and the three people talking all have the same color and the same length of chars in their name.

I figure that even if the people talking luck out and have a shade of green like in my screenshot, it's still better than if they all fell into the identical green bucket.


It could choose two or three colors and split the name in half or thirds.


I'd probably try to convert the RGB to HSV and then sanitize the values a bit. Get rid of too flashy or too unsaturated colors.


This is what Pokémon Showdown does.

https://github.com/Zarel/Pokemon-Showdown-Client/blob/434322...

A naive HSL implementation will lead to very light yellows/cyans and very dark blues. PS corrects for this by manually darkening yellows/cyans and lightening blues.

A better solution might be to use a color model based on perceived luminance, like one discussed here: https://news.ycombinator.com/item?id=11437794


I wrote about my own implementation for something like this for a web irc client, which may be helpful.

https://gist.github.com/0x263b/2bdd90886c2036a1ad5bcf06d6e6f...


I usually find that the images that users use on forums, especially when they are somewhat odd-looking, really reinforces who is saying what.

Maybe there is some scope for taking distinctive glyphicons from a project like Bootstrap and displaying it next to the username. And combine this with your color scheme, I think it might become easier to keep track of threads. Although, some people may not like the icon associated to them.


It'd be cool if it showed the number of anonymous users creepily watching the conversation too.


Another chat app with mostly arbitrary ways to communicate? No thanks. I understand this is for HN community, but with XMPP, ICQ derivatives, IRC, etc I already have too many spaces to keep up with.

Its nice though, I like the profile key integration.


username checks out


Sorry about that I don't mean to shit on your project; honestly its pretty damn cool. I like the usage of django/daphne for a single page app...it came out nice.

I just don't see the usability cause I already have multiple messaging/chatroom services.


Yeah, it would definitely be more interesting if it allowed users to connect via XMPP/IRC/telnet like PSYCed server does, for example.


This is secretly a way for op to harvest IP addresses of usernames! /tinfoilhat


And then...?


Step 1. Harvest IP Addresses

Step 2. ????

Step 3. Profit


I've been idling in #hn on freenode for years now, and sadly it's consistently been dead, activity wise. Eager to see if hnchat can change the game.


#startups is where you should go on freenode thats where many HN'ers hang out.


Come over to #startups

We are an international bunch of tech entrepreneurs and the channel is usually pretty active.


...But what if you're the rare HNer than doesn't actually care about startups?


I thought most people don't care at all about startups. I come here for hard tech (which is honestly lacking), hive mind opinion research, and, most of all, unfiltered snark.


still a nice group of irc people


Well, yes, there is that. Unfortunately, IRC channels have enforced topics: those of us who are on HN more so for the cool tech stuff, and less so for the startups cannot contribute to the forum: This is why things like HN Chat are useful: the enforced topics, if any, are broad enough for the HN community to all be able to talk. Although, once again, they would do well to be more integrated with established communications technologies (IRC, etc.).


This was the most useful comment in this thread. Am now on #startups.


Unfortunately full of people attempting to XSS and spam unicode. I think I'll stick with IRC :)


Yeah, the thing is, this needs some kind of IRC bridge, with auth. If you're an HN user, IRC is probably your usual mechanism for realtime textual communication, and I gather many would rather use their very rich tooling built on IRC than check another website.


Why do you assume your preference for IRC is everyone's preference?


I don't. I see a lot of IRC users on HN and other forums. Slack seems semi-common internal to orgs, but IRC seems to be by far the most active realtime communication medium used by devs externally.

People liking IRC is a reasonable conclusion to draw.


> If you're an HN user, IRC is probably your usual mechanism for realtime textual communication

Mine happens to be Facebook Messenger.


...huh. FBM appears to be a centralized two-way textual communcation system with a strong identity system: It's essentially the anti-IRC. What do you use for multi-way textual communication, or textual communication with weak identity (these often go hand-in-hand)? Or do you just not use either?


I should mention here that I work for Facebook. (Though I would also like to make clear that this post and anything else I do on HN is my personal opinion and does not represent Facebook in any way)

You are mistaken: FBM supports multi-way communication. For work, I use Messenger almost exclusively. For personal stuff, some combination of Messenger, Google Chat, and SMS/MMS. I do log on to IRC once in a while, mainly Freenode, but it's far from "primary".

Why does the "average" person ever need weak identity communication? I mean, I'm glad it exists and it has a niche, but why would you expect that to be someone's main way of interacting with people?


shrugs I don't know. It happens.

Anyways, there is an issue with FBM's multi-way: It's designed as an invite only system: you have a list of people you want to talk to multi-way, and you talk to them. This is fine in certain contexts, but in other contexts, the "room" abstraction used by IRC is more effective, as it allows you to have conversations with a strictly defined topic, but not strictly defined participants, the opposite of FBM. FBM's system is fine for small-scale multi-way communication between known parties, but that's not what people use IRC for.


> If you're an HN user, IRC is probably your usual mechanism for realtime textual communication

I doubt it. I see less and less developers using IRC outside of quick help and instead using Slack.

A lot of languages and techs have both a Slack and IRC... it's hard to know which one's more active sometimes which is annoying.


I haven't seen Slack used much outside of organizations. However, IRC is everywhere.


IRC isn't everywhere. Even a large channel like freenode's #node.js has maybe 15 regulars, myself included.

Meanwhile, Elm's Slack channel has more regulars than #node.js.

IRC is kept alive by a small holdout. I'm one of those people, but it's no mystery to me why nobody else uses it when I'm paying irccloud.com or running weechat-ncurses on a VPS just for basic features everyone expects from a communication tool.


#python and #ubuntu are heavily filled on freenode with over a thousand users though? As well as #debian and #go-nuts (for Go) I think IRC is plenty popular, now if the vast majority idle is another story, people are from all around the globe.


Like #node.js, they have 1000-2000 users connected with probably the same level of engagement, so probably 98% idle which means it's effectively a chat room for about 15 people.

And each person needs to care enough about IRC (e.g. run a VPS) to receive pings or messages while they are away and to see the message history when they return.

Maybe IRC is "plenty popular" which apparently means popular enough to find someone willing to shoot the shit with you if you're in one of its largest channels. But that's a far cry from "IRC is everywhere".

I use IRC every day. I'm just not left scratching my head when I find out that yet another ecosystem chose Slack/Discord over IRC. It blew me away when I saw how active Elm's Slack was while #elm is dead. But that's pretty much how it is with every community I'm part of with a Slack channel.

Sometimes people here suggest "maybe IRC is just for developers", but you can't even format a code block on IRC. :)


Over a thousand users; I wouldn't consider that popular. There are 6 times more people dying every hour than total number of users in those channels. And many of those probably overlap.


“Large” means #rust on moznet, which normally has around a thousand people in it, and has scores of regulars actively chatting.


From the reply to my sibling post and yours, I stand corrected. It seems IRC is big with older languages like C and related (as in, a similar domain) ones like Rust[1]. JavaScript and new, web related languages like Elm are more likely to use Slack.

[1] I'm curious as to whether that IRC channel is the only "blessed" Rust chat out there. The problem with other languages is that the community makes a Slack for them even though there's an IRC channel for them already and most new users start only going to the Slack.


With Rust, I've only heard of some people making Slacks. I don't use Slack, but at least one person mentioned on IRC that the Rust slack they were in was pretty much dead, so I'm not aware of this happening to Rust yet. We'll see as time goes on. There are something like 50 #rust- channels on Mozilla's IRC and ##rust on Freenode, though.

I've also heard of quite a few very active JavaScript Freenode channels, though Slack does have a lot of inroads there depending on which particular segment of the community you're into.


There are a bunch of substantially less trafficked, though definitely regularly active, channels for Rust: #rust-offtopic, #rust-internals, #rust-beginners (this one is recommended in the official documentation and is well-traficked), #rust-osdev, several others too.


Everywhere as in...? IRC isn't going anywhere for sure, I use it (prefer it to Slack), but its usage has diminished greatly to very niche groups such as anime subtitling communities and programming languages/techs. Of the latter, many are either moving to Slack or also have a Slack with more people on it. I also hear less and less developers using or talking about IRC in general.

Elixir (language), Ember (JavaScript framework), Elm (language) all have more active Slacks than IRCs. Facebook's React moved from Slack to Discord, and the community has never cared for or used their IRC channel.

There's still fairly active IRCs like the JavaScript, Go, Clojure (I think), and the Node ones, but they're becoming the exception.

I think IRC is popular in your group of developers and interests, but for many people it's somehow considered ancient. On an interview I once mentioned IRC and the interviewer (in his 40s) was surprised it was still a thing.


shrugs

Then again, look at the stacks you're looking at: they're all relatively new, and most of them are frontend, and thus more likely to jump on the new shiny. ##c on freenode has >1k users as I write this. Although that's probably also an outlier.

Personally, I'm hoping that Matrix becomes the new standard, if we ever get one beyond IRC. IRC is showing its age, and Matrix seems to be the most practical and levelheaded group doing work on the problem.

As for Slack, I'm pretty lukewarm on it, and kinda prefer IRC.


I stand corrected! See my reply to the sibling comment.


Yeah, that's the kind of distribution I was expecting. I'm glad sibling could get some hard data on it, though.


The only problem you have is that people are leaving all their comments on the chat group instead of in here... :)


A lot of comments don't need to be here. As someone who's perennially on the rate limit list, I'd much prefer to take lengthier discussions off of here.


Oh gosh and it's already devolved into tabs vs spaces and two vs four, what else should I have expected? ;-)

Nice, I'll login later and check it out!


App version for android: http://forty7.org/tmp/hnapp/hnchat.app.arm.apk

I'm making a website tool to convert website to Android apps, so was using this as a test.

If anyone got an x86 android device, I also generated x86 version of the app: http://forty7.org/tmp/hnapp/hnchat.app.x86.apk


The x86 version works well, but isn't 70MB too much for such an application?


I like that I can login without providing my credentials.


    Forbidden (403)

    CSRF verification failed. Request aborted.

    You are seeing this message because this HTTPS site requires 
    a 'Referer header' to be sent by your Web browser, but none 
    was sent. This header is required for security reasons, to 
    ensure that your browser is not being hijacked by third parties.
Erm...


I really dig the login system!

I thought it should be vulnerable to 1. find hash on victim's profile, 2. login using the hash + username

But it seems the hash is never actually submitted to the server, neither through the login form nor later on by cookie. That is good news! The implied hurdle is that you'll need to update the hash on each login.


I've been saving a similar idea of getting people to authenticate with custom text in their bios. Would be clever if the app tricked you into verifying a third party account on keybase too.


Good stuff!

The "Login to chat" should link to the login page.


someone called for this on another site recently: http://www.newschoolers.com/forum/thread/845014/NS-MEMBER-CH...

- maybe some way to have minimum karma to join, or at least a way to only see messages according to certain metrics, eg acct age, karma, avg post karma -- or else have those users in different colors, including being invisible

- ability to block people

- message replying

- toggle message storage, either for user or admin

- pausing

- users can make comments in another user's chat profile, with ability for underlying user to reply

- highlight another user's conversation, or have different conversations in different colors

- this might actually work for instagram, where any user can keep a chatspace for their followers - perhaps a new url is provided upon each new photo, that way the users have to view the underlying instagram account, and the chatspace is cleared regularly (GramChat.)


`Add the following token to your HN Bio` on login screen. What means `HN Bio` ?

Sorry, for dumb question.


Looks like you figured it out, but for anyone else following along.. Click your username and you'll be taken to a page like https://news.ycombinator.com/user?id=indirpir where you can place your token.


But how do I downvote the chats?


I'm getting a 500 from Heroku.

btw, care to share the tech stack this is using?


Seems it's Python/Django/Daphne.


Should be back up! And, yup as milankragujevic said, python/django/daphne


Neat! I love it!

What's it written in and can I host something similar myself?


What I liked the most is the fact that it creates a kind of hackernews oauth. Using this mechanism, you can have something like "Login with hackernews" apps. Cool!


Would be nice if it had a list of top articles that drill down to open in new window | chat (creates a private room for that article | and view comments/threads.


It would be nice to have tab completion for typing usernames.


HTTP 503 Service Unavailable "Request queue full."


I'm using this on mobile and the scroll is very sluggish, you could add this you your scrollable div:

  -webkit-overflow-scrolling: touch;


Aaaaand we broke it.


yep. should've implemented rate limiting. and probably memcached. and not heroku free.


Haha definitely a work in progress. Will fix this all soon.


> Add the following token to your HN bio: hnchat:p2z9iJCaT5ZXWlWp5Vua

Smart idea to verify users


Makes me wonder if I should modify RaspChat (yes it was posted before http://beta.raspchat.com ) to actually play well with HackerNews.


I love this thing


please add a mute feature, tga is annoying


WOW Hackers :D


Nice app, but reading the unfiltered drivel of tech executives in real time is truly more than I can handle.


I too enjoy signalling my superiority over others!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: