8

cross-posted from: https://lemmy.ml/post/1507151

I'm trying to build a minimal CLI that would sync subscriptions between 2 or more lemmy accounts.

To do so, the CLI would need to:

  1. login to each account. For this I can use the login endpoint.
  2. get a list of subscriptions from each account. <- This is where I'm currently stuck.
  3. subscribe the accounts to the communities of other accounts. I think I can use the followCommunity endpoint.

My question is, how do I get a list of communities that a user follows?

top 2 comments
sorted by: hot top controversial new old
[-] Irisos@lemmy.umainfo.live 3 points 1 year ago* (last edited 1 year ago)

/api/v3/site returns an object with the property "my_user" which itself has a property "follows".

For more details on the objects structure. The api documentation on join-lemmy should suffice.

[-] FracturedPelvis@lemmy.ml 1 points 1 year ago

This looks ideal! However, I haven't managed to get the /site endpoint to return a my_user value. Even if I provide authentication:

{
    "auth": "<token>"
}
load more comments
view more: next ›
this post was submitted on 25 Jun 2023
8 points (100.0% liked)

General Programming Discussion

7701 readers
11 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 5 years ago
MODERATORS