Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Reddit's API Changes (github.com/libreddit)
24 points by deutschepost on May 26, 2023 | hide | past | favorite | 25 comments


It would be a real shame if libreddit were to log the requests made by the Android app and try to replicate them, using this code to sign the "x-hmac-signed-body" and "x-hmac-signed-result" headers in the https://accounts.reddit.com/api/login request.

    func (c *Client) generateResultData(epoch int64) string {
        return fmt.Sprintf("Epoch:%d|User-Agent:%s|Client-Vendor-ID:%s", epoch, c.userAgent, c.clientVendorID)
    }

    func (c *Client) generateBodyData(epoch int64, body []byte) string {
        return fmt.Sprintf("Epoch:%d|Body:%s", epoch, string(body))
    }

    func hmacSignData(data string) string {
        digester := hmac.New(sha256.New, []byte(REDDIT_ANDROID_HMAC_SECRET))
        digester.Write([]byte(data))
        return hex.EncodeToString(digester.Sum(nil))
    }

    REDDIT_ANDROID_OAUTH_CLIENT_ID = "ohXpoqrZYub1kg"
    REDDIT_ANDROID_HMAC_SECRET = "8c7abaa5f905f70400c81bf3a1a101e75f7210104b1991f0cd5240aa80c4d99d"
And then use:

    https://oauth.reddit.com/r/%s/about.json
    https://oauth.reddit.com/r/%s/top.json
    https://oauth.reddit.com/search.json
etc.


Sigaloid here (from the linked thread). 1. I can't believe I missed this thread! 2. this is amazing, I _just_ opened an issue looking into the GQL API, but you've done some great work here. I cannot thank you enough. This will help enormously! Hopefully we can prepare for the changes properly.


I also did a little digging on this in 2018, this api allows more granular api control.

There's cool little parameters like rich text element, and other RPAN generally not available to the normal api.


This may come in handy later, thank you.


A real shame indeed ;)


I'm pretty much done with reddit at this point. It is so insanely user hostile. The frontend is a broken pile of shit. And the subreddits are echo chambers controlled by anonymous individuals with no checks and balances and no audit log. Even 4chan is more transparent than that. Every post I make gets removed, either immediately by a bot because the title wasn't in the right format or something, or just silently by a moderator without explanation.

Would really like to see an alternative that doesn't get taken over by nasty vagrants banned from other platforms.


100% agree. Reddit is propped up by its name recognition at this point. In my local city subreddit, I wrote a comment on a political thread. My comment appeared for me -- and clearly did for other users temporarily since it was being voted on. After a few minutes, when viewing the thread not logged in, it revealed my comment was removed by a moderator. The post continued to appear like it was visible to other users when I was viewing it from my account.

It completely killed my spirit for wanting to engage with my local subreddit. This wasn't an isolated incident. I had submitted local news articles previously to the city subreddit only for it to be instantly "shadow banned" (appeared for me, not for others) due to keywords used in the article title. When messaging the moderators asking why the thread wasn't appearing, I never received a response.

No recourse. No accountability.


I would be a perfect time for digg to come back as a barebones reddit, like reddit did with digg


Quora was going in a good direction until it decided to remove question details. It could have easily expanded its offering as a more high brow Reddit, but instead it has seemingly dumped the flavours in favour of mass market low brow content now.

The international subreddits are much more awful than the American ones because they are moderated along American lines despite the cultural and political differences, and always dominated by uneducated American expats who seemingly have no understanding of world cultures or how local cultures interact with the world.


I think it all fell apart around the time of the first Trump election, whether you blame the Trump supporters or badly handled moderation, but the moderation has seemingly turned the website into an echo chamber with a huge American and left-leaning mass market tilt.


What I find very ridiculous is the NSFW alert that appears after you've been reading/watching for quite a while. It's clear what its actual purpose really is.


I've been a reddit user for the past 7-9 years and if i have to quit the service, so be it. This is the straw that broke the camels back after about half a dozen times i have had subreddit takeovers happen because of rogue mods and reddit simply refused to help. Coupled that with the fact that NSFW is being phased out, i don't see a lot of people holding reddit near and dear.

Reddit have had retention issues. They did not mandate email address for years which meant they did not take much data from their users, unlike meta and google.


Old users with karma are fine... if you deleted your account or just started a new account, screw you all your posts get deleted.


What's the issue with NSFW being phased out? All I see it being used for is stupid jokes.


Reddit told Apollo’s dev that they plan yo announce the pricing on upcoming Monday, the 29th. Guess we’ll get more details then.


Came here to say this. Ty.

They aren’t just monetizing they are editing which content shows up in the API, so it’s not just a matter of passing on costs, it’s a question of driving users to the corporate platforms.

We need an open pledge with consequences for companies who offer APIs at this point. Like Twitter, Reddit is screwing their third party ecosystem for shareholder metrics that will help their valuation, and it seems like it’s the pattern over-and-over again.

The shittification of the user experience always happens when the investors want to get paid, and the third parties that invested their lives and livelihoods into the companies precious promises are holding the bag as always. I feel like Reddit used their third party developers and joe are straight up harvesting their efforts — what dev is ever going to want to do this again?

Makes it almost impossible to warrant the effort of building a third party API-based ecosystem. I wonder if that’s something that can be fixed with licenses or something?


Unsurprising. It was only a matter of time.

'Either the API gets blocked for third-party clients, or you purchase a high price for it.' [0]

[0] https://news.ycombinator.com/item?id=25685294


Anyone know of any sane alternatives to reddit?


These days - and I'm being serious - Facebook Groups.

They've gotten fantastic in the last few years. Are lighthearted, comprehensive, tend to have less weirdos (really) and have a moderation log that notifies you what and why it was removed.

Also, Facebook is a more representative slice of America than Reddit or Twitter.


I'm not American, and would like something pseudonymous.


Need to make a new one.

Got to be a hybrid of decentralized and centralized so you can replace it now with an equivalent and then harden it to interference and embolden encryption and hacker ethics over time as social media platforms get sucked in to late empire control complexes.

Is that possible technically? I can see it in my head but I don’t know how to create it.


I think Reddit and other social media share the same problem in that people don't naturally share the same piece of information with EVERYONE they know.

Your girlfriend/boyfriend might be interested in your marriage plans, but your friends might be more interested in talking about games. The former might be horrified at you playing shooting games, and the latter might be horrified that you want kids. In real life the two things would be segregated, but social media is often merged and it's impossible to separate the two.

Social media has got very mass market in recent years and the civil intelligent discussions that you would have when only [traditional] geeky types were around, even between people of differing political views, have gone down the drain. But the main problem with Reddit was that it was too over-zealous with moderation after the Trump election, and it's basically been a downward hill since then since the echo chamber bandwagon just gets more and more self-fulfilling. It's silly to the point many international subreddits are utterly non-sensical and sometimes racist to the country the subreddit covers!


lemmy


You imply reddit is sane. :)


If anyone wants to export a pretty good version of all their reddit data, I wrote an exporter that dumps into SQLite: https://github.com/xavdid/reddit-user-to-sqlite/

It also supports the Reddit GDPR archive format, so you can fetch your whole history of comments/posts (which isn't possible to page via the API).




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

Search: