Reelspan posts to one community on your Lemmy server, as your account. Each post has a title, an optional body, and optionally one image or video, which is uploaded to the server's image host and linked from the post.
What you can post
| Post | How it appears |
|---|---|
| Text | A post with a title and a body |
| Photos | A post linking one image. Only the first photo is used |
| Video | A post linking the video |
The title is lemmy_title, else the first line of the caption (up to 200 characters), else "Untitled". The body is lemmy_description, else description, else the caption when it says more than the title.
The result's url is the post on your server (https://lemmy.world/post/123), and post_id its id.
Connect a community
You need an account on the server that may post in the community. Setup takes about a minute.
- Use an account on your Lemmy server that may post in the community.
- In the Reelspan dashboard, open Accounts → Connect account, choose the profile and Lemmy.
- Enter the server (
lemmy.world), the community, and the account's username and password.
The community is its name as in lemmy.world/c/technology. One on another server is name@server. A !name or a full community link works too.
Reelspan signs in once to get a token and keeps only the token. Your password isn't stored. An account with two-factor sign-in needs it turned off for this.
With the API
curl -X POST https://api.reelspan.com/v1/accounts/lemmy \
-H "Authorization: Bearer $REELSPAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"profile_username": "my-brand", "server": "lemmy.world", "community": "technology", "username": "yourname", "password": "..."}'import { Reelspan } from 'reelspan';
const reelspan = new Reelspan();
await reelspan.accounts.connect('my-brand', 'lemmy', {
server: 'lemmy.world',
community: 'technology',
username: 'yourname',
password: process.env.LEMMY_PASSWORD,
});import os
from reelspan import Reelspan
reelspan = Reelspan()
reelspan.accounts.connect(
"my-brand", "lemmy",
server="lemmy.world", community="technology", username="yourname", password=os.environ["LEMMY_PASSWORD"],
){ "success": true, "platform": "lemmy", "account": "[email protected]", "reconnected": false }| Field | Required | Also accepted (Upload-Post) |
|---|---|---|
server |
Yes | instance_url |
community |
Yes | |
username |
Yes. The username or email | |
password |
Yes. Used once, not kept |
Connecting again replaces the Lemmy account on that profile. See Connect with credentials.
Example post
An image post with a title and a body:
curl -X POST https://api.reelspan.com/v1/posts/photos \
-H "Authorization: Bearer $REELSPAN_API_KEY" \
-F "user=my-brand" \
-F "platform[]=lemmy" \
-F "title=New dashboard" \
-F "lemmy_title=We rebuilt our dashboard around keyboard shortcuts" \
-F "lemmy_description=Every action now has a shortcut. Here is what changed and why." \
-F "photos[][email protected]"import { Reelspan } from 'reelspan';
import { readFile } from 'node:fs/promises';
const reelspan = new Reelspan();
const post = await reelspan.posts.photos({
user: 'my-brand',
platforms: ['lemmy'],
title: 'New dashboard',
photos: [{ data: await readFile('photo1.jpg'), name: 'photo1.jpg', type: 'image/jpeg' }],
extra: {
lemmy_title: 'We rebuilt our dashboard around keyboard shortcuts',
lemmy_description: 'Every action now has a shortcut. Here is what changed and why.',
},
});from reelspan import Reelspan
reelspan = Reelspan()
post = reelspan.posts.photos(
"my-brand", ["lemmy"], ["photo1.jpg"], "New dashboard",
extra={
"lemmy_title": "We rebuilt our dashboard around keyboard shortcuts",
"lemmy_description": "Every action now has a shortcut. Here is what changed and why.",
},
)Fields
| Field | Meaning |
|---|---|
lemmy_title |
The post's title, up to 200 characters in the composer. Falls back to the caption's first line. |
lemmy_description |
The post's body. Falls back to description. |
description |
The body, when lemmy_description isn't sent. |
title |
The caption: its first line is the title and the whole of it the body, when the fields above aren't sent. |
lemmy_nsfw |
true marks the post NSFW. Default false. |
lemmy_first_comment |
Posted as a comment on the post. Falls back to first_comment. |
When you send
lemmy_title, the caption becomes that title too, so send the body inlemmy_descriptionordescription.
In the dashboard composer, the Lemmy tab has an NSFW switch.
Limits and behaviour
- One image or video per post. With several photos, the first is used and the result carries a warning. Videos in
photos[]are left out, with a warning. - Files: up to 100 MB; your server's image host may allow less, or refuse video.
- Token: the token from signing in is kept, encrypted. If the server ends it, posts fail with
reauth_required; connect again. - Your server only: calls go only to the server you named, and never to private network addresses.
Common errors
| Code | When | Fix |
|---|---|---|
INVALID_SERVER |
Connecting: the server isn't an address like lemmy.world |
Enter just the server's address. |
INVALID_CREDENTIALS |
Connecting: the server refused the login, two-factor sign-in is on, or the account still needs its email confirmed or approval | Check the login, turn off two-factor sign-in, or finish the account's setup. |
COMMUNITY_NOT_FOUND |
Connecting: no community by that name on the server | Check the name; use name@server for one on another server. |
reauth_required |
The server no longer accepts the token | Connect again. |
file_too_large |
The file is over 100 MB | Send a smaller file. |
lemmy_error |
The server refused the post or the upload. Retried automatically on 429 and 5xx | Read error for the server's reason. |
MISSING_FIELD |
Connecting without one of the four fields | Send all four. |
Errors when connecting come back as a 400 with the code in error_code. Errors when posting are in that network's result. See Errors.