11
Threativore now provides a REST API (threativore.lemmy.dbzer0.com)
submitted 1 day ago* (last edited 1 hour ago) by db0@lemmy.dbzer0.com to c/lemmy_integrations@lemmy.dbzer0.com

With threativore 0.8.x I have finally released a feature I've been planning for a while, the ability to maintain and view it via REST API.

The first thing that is released in the REST API is the ability to see a user's information, which at the moment contains the user's profile ID, their threativore roles and the newest fields, which is tags for users

{
  "user_url": "https://lemmy.dbzer0.com/u/db0",
  "roles": [
    "UserRoleTypes.MODERATOR",
    "UserRoleTypes.ADMIN"
  ],
  "tags": [
    {
      "tag": "ko-fi_tier",
      "value": "deck hand",
      "flair": "https://lemmy.dbzer0.com/pictrs/image/0cc8915a-acf8-451b-8350-c889f469ac42.webp",
      "expires": "2025-03-15 13:18:46.305405",
      "description": "This user is donating a moderate amount to their instance through Ko-Fi"
    },
    {
      "tag": "pirate",
      "value": "true",
      "flair": "https://lemmy.dbzer0.com/pictrs/image/156d1970-0600-4bea-b3d2-53435be3c314.webp",
      "expires": null,
      "description": "This user likes pirates"
    },
    {
      "tag": "anarchist",
      "value": "true",
      "flair": "https://lemmy.dbzer0.com/pictrs/image/61a552e5-d1db-43a5-a120-f584e3082c2d.webp",
      "expires": null,
      "description": "This user likes anarchism"
    },
    {
      "tag": "foss",
      "value": "true",
      "flair": "https://lemmy.dbzer0.com/pictrs/image/00ac9132-cecd-41e6-ba81-8ffd51043bdd.webp",
      "expires": "2025-01-14 13:07:57.467910",
      "description": "This user likes free software"
    },
    {
      "tag": "liberapay_tier",
      "value": "powder monkey",
      "flair": null,
      "expires": "2025-03-16 20:05:57.525031",
      "description": "This user is donating a moderate amount to their instance through Liberapay"
    }
  ]
}

The tags are free-form and any threativore admin can assign any tags to any users with whatever values. For example one of my plan in lemmy.dbzer0.com is to add a boolean tag for pirate if the user mentioned a pirate in their application form, or alternatively anarchist or FOSS respectively. Likewise I have automated adding tags based on whether someone has donated to the site through ko-fi recently and at which tier.

Currently these tags don't have any effect, but I want to bring together the various frontend developers, such as @ptz@dubvee.org from tesseract, @sheodox@lemmy.world from alexandrite, @aeharding@vger.social and so on to see if we can come up with a standard where we can specify within threativore how the tags could be utilized. Or perhaps agree for a standard location where the threativore can always be sought by UIs to retrieve info (as it's not part of the lemmy API proper)

For example I can arrange for a new field per tag, which would contain an emoji code, or an image url, which would be displayed by the UI as flavor for that user. I want to provide ways for each instance to be more unique, (until and if lemmy itself adds such functionality in the backend).

Another functionality which is not immediately obvious is that I now added code to allow threativore to reach in directly to the lemmy DB and extract any data needed. This is for example how lemmy.dbzer0.com can match users on ko-fi with users in lemmy. I plan to extend this functionality in the future to hopefully provide more ways for threativore to detect and deal threats, even without info publicly available in the API.

With all this I want to make threativore a valuable companion software to lemmy, to provide a lot more extensibility through the UIs and empower instance admins to do even more for the looks and security of their instances.

If you want to deploy threativore, I provide a simply code chunk you can add to your lemmy UI in docker-compose. You can even disable the anti-spam capabilities if you want (although they don't do anything until you populate them), and just keep it as an API only.

Let me know what you think.

you are viewing a single comment's thread
view the rest of the comments
[-] andrew_s@piefed.social 2 points 1 day ago

Maybe you already know this, and it wasn't your intention, but those Mentions in the post body won't page the relevant people - it only works if they're in a comment.

[-] db0@lemmy.dbzer0.com 1 points 1 day ago

Oh I had forgotten that. Lemme do some pings in the comments

this post was submitted on 13 Jan 2025
11 points (100.0% liked)

Lemmy Integrations

248 readers
6 users here now

A community about all integrations with the lemmy API. Bots, Scripts, New Apps, etc.

founded 11 months ago
MODERATORS