pull down to refresh

This site's inspiration, Hacker News, has had an API for ages:

https://github.com/HackerNews/API

Why doesn't Stacker News have one? Being able to read HN without a web browser is bliss, like Usenet in the old days. I'd much rather read Stacker News that way than HN, but you're not giving us a choice here...

8344 sats \ 3 replies \ @anon 8 Dec 2023

I have to say that using LN to upvote posts is pretty addictive (I've been reading this site for about a month but this is my first time actually sending sats).

It's like flinging nickels at people. Disturbingly fun. You can do it to people who help you and to people who annoy you. Very strange.

reply

Why no account though with LNURL-auth?

You'll just be a random pubkey until you want to set your nym. This way, you'll receive any sats that you got zapped in your account.

Any sats that @anon got zapped ends up in the daily reward pool

reply

Electrum doesn't support lnurl-auth (as far as I can tell).

I'm seriously considering implementing it myself, because it looks like all the clients that do support it are either idiotphone apps or else bloated piles of electron.

I don't suppose there are any command-line lnurl-api clients? Maybe in rust? Okay I'm probably pushing my luck there.

reply
I'm seriously considering implementing it myself, because it looks like all the clients that do support it are either idiotphone apps or else bloated piles of electron.

If it helps, you could say I implemented the wallet/client part of LNURL-auth for tests here in Golang.

reply

You can use the api if you’re clever enough

reply

Yes but nobody's going to put serious effort into writing software for a bootleg reverse-engineered API that can be vanished at any time with no reputational consequences for the site.

Come on guys. Man up. Free the WOT!

reply

two people already started

Also, I just remembered that @elvismercury was playing around with the GraphQL playground here

Isn't this already like a public, documented API?

You can even use it from your browser, lol

So at least the argument that you have to reverse-engineer it no longer holds

reply

The whole point is to not need a browser.

reply

It's GraphQL. You don't need a browser. I said you can even use it from your browser.

The playground is there to make it easy to get into. To just play around initially.

If you want the GraphQL API schema in plaintext, it's here.

Now do some PoW or wait until we're ready :)

reply
1201 sats \ 1 reply \ @anon 8 Dec 2023
Now do some PoW or wait until we're ready :)

Speaking of which, if you're really determined to use GraphQL as your API, please be ready to charge a few sats per API call. Because if not some moronic idiot is going to think it's funny to flood the site with compute-expensive calls.

Every site I know of that exposes a GraphQL API is eventually forced to either (a) put users through CAPTCHA-hell (b) do browser fingerprinting, usually via cloudflare, (c) some kind of real-world identity linkage like SMS verification, or (d) some combination of the above.

I would hate to see that happen to SN.

I probably can't convince you that exposing GraphQL to anonymous callers is a bad idea, so hopefully I can convince you to be ready with something less awful than (a)(b)(c)(d) when the inevitable result occurs.

Thanks again for creating this awesome site.

reply
Speaking of which, if you're really determined to use GraphQL as your API, please be ready to charge a few sats per API call. Because if not some moronic idiot is going to think it's funny to flood the site with compute-expensive calls.

we've considered it. we're going to do it when it's needed :)

so enjoy the free ride as long as it's possible :)

I probably can't convince you that exposing GraphQL to anonymous callers is a bad idea, so hopefully I can convince you to be ready with something less awful than (a)(b)(c)(d) when the inevitable result occurs.

no, you can, you actually don't even have to because i already somewhat agree :)

we're aware that GraphQL is vulnerable to https://hygraph.com/blog/graphql-n-1-problem and some malicious actor ... not going to continue for hopefully obvious reasons :)

You don't need a browser

I sure looks like you do:

SN_AUTH_COOKIE must be set with a valid session cookie.
Some functions need authentication. Right now this is handled by pasting you session cookie into a .env file under SN_AUTH_COOKIE. How to Retrieve a Cookie from a Web Request: Open Developer Tools ...
reply

yes yes, you are right, i forgot about this :)

i think i am using ":)" so much it might actually start looking like i mean it in a "sarcastic way", lol

reply
bootleg reverse-engineered API that can be vanished at any time with no reputational consequences for the site.

I think you just answered your own question:

Why doesn't Stacker News have one?

This, lol

This site has no documented public API because... I'm sure you'll be able to guess :)

Or should I say no API that is documented in the form one might expect when they hear "documented API" :)

reply
Why doesn't Stacker News have one?

@anon, I dare you to guess!

reply