פרסום הודעות ל-Mastodon

This topic covers publishing posts from Discourse to Mastodon with the Discourse ActivityPub Plugin, and follows on from Setting up an ActivityPub Actor and Following an ActivityPub Actor. If you’re not sure what this means, head on over to the Discourse ActivityPub Plugin topic first.

Instructions

To publish to Mastodon:

  1. Set up an actor for the Category or Tag you want to publish content to Mastodon.
  2. Copy the “handle” of the Actor.
  3. Look up the handle on Mastodon and follow it.

[note] markup

You can select part of your post to be published via ActivityPub by wrapping text in [note][/note]. This gives you more control over what appears on microblogging services like Mastodon. For example, if your post looks like this in the composer:

We have some exciting news to share: [note]Everything Pets is launching a magazine![/note]

This will appear on Mastodon:

Everything Pets is launching a magazine!

4 לייקים

Hi, currently the posts by actors on Mastodon seem to miss a profile picture, which makes them look meh:

Is it possible to either use the avatar of the Discourse user posting, or at least the Discourse instance small logo?

2 לייקים

I tried this for the first time and didn’t work as expected:

  • Used on a tag.
  • Edit Actor > Post object type > Note

Is the note syntax supposed to be visible for readers in the Discourse post?

Then the full post was federated anyway, without the note syntax visible:

For what is worth it, first I published the Discourse post with the notes. Then, during the 5 minutes before it is federated, I removed the note tags because they were ugly and I was confused. Then I thought maybe they “disappear” after the post is federated and I added them again.

After seeing that the full post had been federated, I removed the note syntax from the Discourse post.

Did you forget to mention [/note] ?

An example would be :

[note]The Social Music Network is a community[/note] that encourages...

In this example, only the first seven words would be sent to Mastodon (and the Fediverse).

The tags do not need to be at the beginning of the post. If they are not present, then the first 500 characters will be used as an excerpt.

2 לייקים

Or the whole post if Activity pub note excerpt maxlength = 0

Now I’m not totally sure, but I have weak memory print where if that setting is zero then [note][/note] doesn’t do anything.

לייק 1

בדיוק, במהלך חמש הדקות לפני שהפוסט פדרט, הסרתי את התגים של ההערות כי הם היו מכוערים והיו מבלבלים אותי. אחר כך חשבתי שאולי הם “נעלמים” אחרי שהפוסט פדרט, ולכן הוספתי אותם שוב.

אני קצת מבולבל. האם התגים היו קיימים כאשר הפוסט הועבר לראשונה באופן פדרציה?

לייק 1

Thank you for your questions!

No, you can see it there in the screenshot I shared. Does it make a difference if both enclosures are in different paragraphs?

Ah, we do have this set to 0, but I didn’t understand from the description that notes won’t work if set to 0.

Yes the tag we use to federate topics was there from the beginning and remained untouched. It’s the note syntax that went forth and back.

I don’t know if that’s true. I just have such feeling. Try what happens?

Yes, sorry by “tags” I meant [note][/note]. I’m still a little unclear as to whether they were in the post at the time the post was federated. If you added them back in after federation they are not going to apply to content that is already federated.

לייק 1

Ok, yes, [note][/note] was in place when I posted the new topic on discourse and they were also in place after a few minutes when the topic was federated.

Maybe we can leave this here, and next time we federate a post I will be paying attention on every step, now that I know what tp expect and what might happen.

Sorry I’m still a little unclear. Apologies, maybe I’m just being a bit slow today! Did this series of events occur?

  1. You created a new post in Discourse with [note][/note] tags included.
  2. The post was scheduled to be published via ActivityPub in 5 minutes time.
  3. Prior to the scheduled publication you removed the [note][/note] tags
  4. The post was published via ActivityPub.
  5. After the post was published via ActivityPub you re-added the [note][/note] tags to the post.

Is that what happened?

@angus not quite. :slight_smile: I’d swear it went like this, but after so much discussion I’m starting to doubt.

  1. I created a new post in Discourse with [note][/note] tags included.
  2. The post was scheduled to be published via ActivityPub in 5 minutes time.
  3. Prior to the scheduled publication I removed the [note][/note] tags because I wasn’t expecting them to be visible in the post.
  4. But then I thought “whatever, maybe they disappear after the post is federated, somehow” and I put them back.
  5. The post was published via ActivityPub.

הוספתי שחקנים (actors) עבור מספר תגיות ואז יצרתי פוסט באמצעות התגיות הללו. ציפיתי ששני השחקנים יפרסמו ל-ActivityPub, אבל רק אחד מהם עשה זאת.

אני עוקב אחרי שניהם בחשבון ה-mastodon.social הראשי שלי, אבל אני רואה רק פוסט אחד בלוגים. האם זה אמור לעבוד או שרק שחקן אחד נתמך?

אם יש לך מספר actors של תגים המשויכים לפוסט, רק ה-actor של התג הראשון ברשימה יפרסם את הפוסט כרגע. הוספת תמיכה בפרסום ממספר actors מאותו סוג טקסונומי בבת אחת היא #בקשת_תכונה טובה (תייגו אותה activitypub).

האם יש דרך לשלוט אילו קטגוריות או תגיות לא מתפרסמות למסטודון? אני רוצה להוציא נושאי דיון פנימיים מסוימים מפרסום, אך עדיין לאפשר הודעות ופוסטים בבלוג. תודה מראש!

היי @Kayaart, תודה על השאלה. רק התגים והקטגוריות שהגדרת במפורש כשחקני ActivityPub יפרסמו תוכן לפדברס. אם יש לך קטגוריות ותגים לדיון פנימי, פשוט השאר אותם כפי שהם (כלומר, אל תגדיר שחקן).

תודה רבה על ההבהרה, עכשיו זה ברור!
אז רק לוודא: אם אשאיר קטגוריות/תגיות מסוימות ללא הגדרת ActivityPub Actor, שום דבר מהן לא יישלח ל-Mastodon, נכון?

כן, זה נכון.

בלשונית הפדרציה בדף פרופיל המשתמש, קיימת תצורה להוספת חשבונות מקושרים עם אפשרות לסוג דיסקרוס או מסטודון.

פוסטים המשויכים לחשבון מקושר ייוחסו לחשבונך.

כיצד זה עובד? אם אני מוסיף חשבון מסטודון כאן, האם הפוסטים שלי ממסטודון יופיעו בדיסקרוס או שזה בכיוון ההפוך? אם הראשון, כיצד נבחרות תגיות וקטגוריות? אם אני מוסיף חשבון דיסקרוס כאן, האם פוסטים מהשרת החיצוני יתווספו לזה שעליו הוגדרה התצורה? שוב, מה אם הקטגוריות והתגיות אינן עקביות?

אני מארח גם דיסקרוס וגם מסטודון, ויש לי גם חשבון במופע הדיסקרוס הזה. אני מדמיין שהתצורה הטובה ביותר עבורי תהיה שפוסט בכל אחד ממופעי הדיסקרוס יופיע בשני השרתים ויופיע פעם אחת במסטודון. כיצד זה יוגדר תלוי בתשובה לשאלה הקודמת.

בנוסף, מה לגבי מענה לפוסטים ב-ActivityPub? האם אני יכול להשתמש במסטודון כדי להשיב לפוסט של חשבון מקושר עבור קטגוריות, תגיות ומשתמשים?

Hey @ericomeehan,

Neither! This feature allows you to associate posts with your account if those posts are federated via the normal process, e.g. via categories or tag actors. To give an example:

  1. You have a category on your Discourse called “Announcements”, which you set up with full topic ActivityPub publishing.
  2. You have a user account on your Discourse, eric_discourse.
  3. You have a user account on your Mastodon, eric_mastodon.
  4. You follow “Announcements” with eric_mastodon.
  5. eric_discourse (i.e. you) creates a new topic in “Announcements”.
  6. Announcements federates the topic.
  7. You respond to that topic on Mastodon with eric_mastodon.
  8. Your response is processed by your Discourse Announcements category, appearing as a reply (post) in the topic.
  9. There is nothing to associate eric_mastodon with eric_discourse so the ActivityPub plugin creates a staged user for eric_mastodon’s reply post, eric_mastodon1 (the username is generated from the username of the Actor).
  10. The topic now looks like this:
  • First post from eric_discourse.
  • Reply (second) post from eric_mastodon1.

The feature you’re referring to allows you to prove that you are eric_mastodon1, so that you don’t have multiple user accounts on your Discourse. Once you complete the authorization process in that tab:

  • eric_mastodon1’s posts will be eric_discourse’s posts.
  • eric_mastodon1 will no longer exist.
  • Future activity from eric_mastodon will be associated with eric_discourse on your Discourse instance.
2 לייקים