I wanted to be able to make apps that do social login with HN so I hacked it together. It works like you would expect -- generating a code you can put in your profile. For convenience, you can then use either TOTP or Email (if you specify both, it will default to using TOTP) to login thereafter to make things quicker (it can take up to a minute until profiles update). I generally wait about 5 seconds between checks of a profile, hopefully this isn't too much additional strain (especially since I expect most people to switch to something faster after the first login). [EDIT] Also it's night time (well morning I guess) where I am so... spinning up some more instances and I'm going to sleep. [EDIT2] My email is plastered all over the site, but please feel free to email me any bug reports! [EDIT3] If you'd like to register an app, please check out https://mailing-list.vadosware.io/subscription/form ! Ignore all the other mailing list stuff and get on the "early adopters" list for LoginWithHN! Or just email me in my HN profile, whichever!
> you can then use either TOTP or Email (if you specify both, it will default to using TOTP) to login thereafter to make things quicker (it can take up to a minute until profiles update).
I guess at this point it's more like login with loginwithhn?
Yup! LoginWithHN is the OAuth provider :) so the idea is if you have an app that you want people to use to login with HN, via LoginWithHN then you can use loginwithhn.com to make it happen
> I generally wait about 5 seconds between checks of a profile
If you're scraping HN, please wait 30 seconds (https://news.ycombinator.com/robots.txt) - our app server still runs on a single core, so we don't have a lot of performance to spare. (Hopefully that will change this year.) If you need to check more frequently, https://github.com/HackerNews/API works fine and you can get JSON that way anyhow.
Hey Dang, so actually I DO wait 30 seconds -- what actually happens is that I check on the frontend every 5, but the backend checks every 30 (that's the default) interval. If you can believe it the code looks something like this:
The code isn't F/OSS but I hope you can take my word on this, worst case what happens is that someone launches two intervals (I don't have any locking on that side) due to hitting two different machines.
I'll be switching to the API by the end today and worst case by the weekend. [EDIT] Forgot to add this -- hope I didn't cause any disruption on your end. thanks for all the hard work as always.
Comments (149) 35 threads
Show all comments
Showing thread 2 of 35
I wanted to be able to make apps that do social login with HN so I hacked it together.
It works like you would expect -- generating a code you can put in your profile. For convenience, you can then use either TOTP or Email (if you specify both, it will default to using TOTP) to login thereafter to make things quicker (it can take up to a minute until profiles update).
I generally wait about 5 seconds between checks of a profile, hopefully this isn't too much additional strain (especially since I expect most people to switch to something faster after the first login).
[EDIT] Also it's night time (well morning I guess) where I am so... spinning up some more instances and I'm going to sleep.
[EDIT2] My email is plastered all over the site, but please feel free to email me any bug reports!
[EDIT3] If you'd like to register an app, please check out https://mailing-list.vadosware.io/subscription/form ! Ignore all the other mailing list stuff and get on the "early adopters" list for LoginWithHN! Or just email me in my HN profile, whichever!
I guess at this point it's more like login with loginwithhn?
If you're scraping HN, please wait 30 seconds (https://news.ycombinator.com/robots.txt) - our app server still runs on a single core, so we don't have a lot of performance to spare. (Hopefully that will change this year.)
If you need to check more frequently, https://github.com/HackerNews/API works fine and you can get JSON that way anyhow.
I'll be switching to the API by the end today and worst case by the weekend.
[EDIT] Forgot to add this -- hope I didn't cause any disruption on your end. thanks for all the hard work as always.
[1] https://firebase.google.com/docs/libraries#client-sdks
[2] https://hacker-news.firebaseio.com/v0/user/hardwaresofton/ab...