Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting feeds from Multireddit #38

Open
ikuraj opened this issue Oct 14, 2022 · 0 comments
Open

Getting feeds from Multireddit #38

ikuraj opened this issue Oct 14, 2022 · 0 comments

Comments

@ikuraj
Copy link

ikuraj commented Oct 14, 2022

What would need to be done to allow fetching from a user's Multireddit?

I had issues with the fetching part itself. I tried two alternatives, without success:

  • fetching from "user/USERNAME/m/MULTINAME/top" + ".json"
  • do an OAUTH backed request to the same URL, but prefixed "https://oauth.reddit.com/", with the following code
(request-response-data
 (request "https://oauth.reddit.com/user/USERNAME/m/MULTINAME/top"
   :complete
   (cl-function
    (lambda (&rest data &allow-other-keys)
      (print data)
      ))
   :sync nil
   :type "GET"
   :parser #'json-read
   :headers `(
              ("User-Agent" . "md4rd")
              ("Authorization" . ,(format  "bearer %s" md4rd--oauth-access-token))
              )
   ))

It seems that md4rd parses JSON by fetching from an URL of a Reddit sub, adding ".json" at the end. Note that this method works for multireddits as well, in the browser, but not in Emacs (i.e. when called the same way as done in md4rd).

I couldn't find any super-helpful info in the official API docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant