As you may or may not know, I've been making comments on each of the daily @saloon posts, sharing the earnings from my home mining rig from the previous day, along with a running total. You can find the most recent of those comments here.
As you also may or may not know, I contributed several commits to stacker.news itself last year, before my free time dwindled and I had to step away. I still hope to return at some point. Needless to say, I am familiar with the internals of the platform (though I suspect things have changed even in the short time I've been away!)
Anyway, as a software engineer, it pains me to do repetitive tasks on the computer over and over again. So, inspiration struck! I decided to write some code that would help me make these daily comments, saving myself some time and making it easier to continue my streak.
I won't go through all the technical details here, you can look at the code if you're interested. But in a nutshell, this code:
  1. queries the mining pool that I use (BraiinsPool) to find my mining earnings
  2. queries stacker.news to find @saloon's daily post and my old comments
  3. submits comments to stacker.news, sharing my mining progress
  4. has some other easter eggs ;)
I actually wrote about this work in a comment here. Consider this to be the precusor or the rough draft to this post.
So why am I posting this? I guess I like to share my projects sometimes, and I also hope to inspire others to explore interacting with systems they frequent via API, it's cool.
The source code can be found here. Feel free to fork it, or do whatever you like, it's MIT-licensed. I don't plan on accepting PRs, though, so consider any fork to be a "hard fork" :) (get it?).
Thanks for reading.
Oh didn't know SN has an API. Or is that just for step 1?
reply
It's an undocumented API. It's what the SN UI uses to talk to the backend (GraphQL API).
You have to use a session cookie from your browser to make it work. Not the most ideal, but it gets the job done!
reply
336 sats \ 1 reply \ @random_ 29 Feb
You have to use a session cookie from your browser to make it work. Not the most ideal, but it gets the job done!
reply
Cool, there we go!
reply
I was wondering about an API. Posting fees should reduce the danger of such an API but I understand the desire to keep easy usage to those entities who can act as humans (and their browsers) do.
reply
Great perfect for me, i have to try it for sure :)
deleted by author
reply
Take a look here for a breakdown on my mining rig
reply