Follow

I'm happy to announce that my barebones ActivityPub server, implemented in Node.js/Express, is now open source! I intend for it to be a reference implementation for developers who are adding ActivityPub to their own services, but also it is an application server that you can build on if you want.

In other words, t's a few hundred lines of code that lets you create Mastodon-compatible accounts that can accept follow requests and post stuff to their followers.

github.com/dariusk/express-act

I actually built a little toy service (that I will also eventually open source) which converts any RSS feed to an ActivityPub actor that you can subscribe to in Mastodon (or any other AP-compatible client).

Play with it if you like! It is SUPER rough and most feeds end up horribly rendered in Mastodon but it's still kinda cool to see it work: bots.tinysubversions.com/conve

@djoerd @darius Just a heads up, getting this is Amaroq when I select your djoerd link.

@aral @djoerd I'll poke at it. Currently it's only tested in the Mastodon web client

@darius this is exactly the service I intended to start building in a few weeks. Please alert me when you share the source! I have a project in mind that this would be a huge leg up for.

@darius I just tested this on my local machine and it works great. I still need to understand the basics of ActivityPub and what I could do with this. But what sprung to mind: If it is that easy to create accounts and automate stuff with it, isn't this just another spam-flood waiting to happen?

@frank Yup. I think that's inevitable in any decentralized open system like email. I imagine what's going to have to happen is some kind of group anti spam solution (formal shared server blocks specifically for spam behavior that admins can subscribe to).

@darius

Thanks for building this.

I set up @Algot

and then did a feed update.

As yet, the account has not displayed anything via the Mastodon web client.

@Algot Did you follow the account? Its updates will only appear in your notifications feed because there is no persistence for a "profile" page with a list of posts (yet)

@Algot if you update again with a new post, let me know, I'm following it now too

@darius

I'll go do that next.

Does it matter how many items are in the feed?

@Algot No, it shouldn't. It just does a diff every time it polls the feed and then posts any new items.

@Algot I'll check my server logs when I get a chance, too

@darius

How does my mastodon account get a notification?

I have followed the @Algot

But how does that account know that my masto account exists to notify me?

By way of my follow?

@Algot when you follow an account you send it a "Follow" message, and then that account adds your account to a local database. Then when it makes a post you're in the list of accounts to notify.

@darius

Just did a site update to the RSS file with a timestamp of

Sat Sep 15 2018 16:20:00 GMT

now I wait.

@Algot Something seems not working, I'll try and figure it out!

@Algot I fixed it! Just a silly bug in my code. Your next RSS update should post to you within a minute or two. (the account I'm screenshotting here is @dfktest , I just copied your RSS feed to my own server and added/removed items for my own testing purposes)

@darius

Glad to serve as a code-test guinea pig!

@darius

Nothing has shown up here yet.

Should I see a notification with a message including my .art account name?

Or will the bot's toot only appear in my home timeline...where it might go by sometimes without being seen.

@Algot It simply appears in your home timeline. It's not a notification.

@darius

As I sit thinking about it, I'll probably not use this tool as-is (or ask others to follow the account) if the bot doesn't send a notification.

That's not actually a complaint. I understand the idea it is just doing a standard toot and that that is what most bots should do.

But as a way to be sure I know about updates to a very intermittent RSS feed like mine, someone would too often miss that a new post had occurred.

@Algot It only appears in your timeline, not as a notification. If you want to prioritize it you could always make a list for RSS feeds. But it's essentially like following the feed for any website or company or person -- most updates do not get addressed directly to you.

@darius

I remain very impressed with the concept of making RSS accessible using ActivityPub.

I am a fan of the RSS feed concept, and your work clearly shows that it can have legs in the fediverse, too.

@Algot Thanks! What I actually hope happens is that clients begin to support things like "notify me in my notifications column every time this account posts even if it's not directed at me". My hope is that by providing these kinds of tools, client implementors will be incentivized to support them.

@darius

Have you reached out to the main Mastodon/Pleroma/PixelFed/etc.
developers?

I would expect that they would be interested in your ideas.

@Algot Yes! I even know some people involved in ActivityPub itself.

@darius

I'll be interested to see how this whole federation thing continues to develop.

Accessory projects like your bot have real potential to enrich the system.

@darius

I do follow a lot of people, probably more than I should, but I like to be able to catch onto new ideas like yours as random people I follow boost posts like yours.

@darius

I see the profile page but have had no notifications.

I did follow the account and can see the account (with a nice avatar image built from my RSS header graphic - COOL!)

@darius nice, that’s exactly the use case I want this for. I’m also tempted to port this to Python/Flask for better integration into Publ.

@darius meanwhile I made @fluffy. I hope that by “RSS” you mean”RSS/Atom” since I’m all-in on Atom these days. :)

@fluffy I haven't tested it but it seems like it works! I am relying on a very very small subset of RSS that is probably in every atom feed

@darius the Atom DTD is completely different than the RSS DTD though. Atom is a strict functionality superset at least. Are you using an existing feed parsing library? Most of those do a good job of working with both.

@darius I need to finish my Bridgy Fed set up but I was able to turn my blog into a Fediverse instance at jgmac1106@jgregorymcverry.com

@darius it didn't work. :( It only took me to /u/test instead of the user page for the bot I tried making, and when I manually changed the URL, it said no bot was found.

@darius also it appears to have changed the test profile to the RSS feed I chose, or we both had the same weird idea for what feed to try... (your Mastodon profile's own RSS feed...)

@dave that is what happened! It redirected you because the feed already exists as "test", heh

@darius oh man, the ol' "it's not a bug, it's a feature" except legit this time! 😃

@darius hey! i was thinking of running a mastodon instance on my server for posting stuff, but i don't want to incur the massive bandwidth usage. would this use less bandwidth than a standard mastodon install? thanks so much!

@lynnesbian Absolutely. You could run this on a very very underpowered machine. It doesn't cache media or even understand anything except "people are following me". It would require some extension -- for example it doesn't render profile pages right now, but you could add views for that kind of thing! (Also my RSS-to-AP converter DOES render these and I will open source it soon, example: bots.tinysubversions.com/u/boi )

@darius Question about licensing: the readme says MIT at the end, but there's no normal slightly tweaked MIT LICENSE file, and the package.json says ISC. What's it under?

@zac @darius just a heads up since credentials are stored in a config.json file rather a .env file they will be exposed to anyone who views your code or remixes your app!

@hypirlink @zac yeah good catch. I should probably switch to a .env anyway

@darius Can’t wait to check it out; thank you for making and sharing this :)

@darius 🤔 this is nice! Can it be run standalone and controlled via command line?

@brandon no, it's a reference implementation so it's not really designed to be useful as-is

Sign in to participate in the conversation
Friend Camp

The decentralized web is about trust. You should only join Friend Camp if you personally trust Darius Kazemi with your social media data. You probably only have that level of trust if we are IRL friends or have been internet friends for a long time. Generally speaking this is a small, closed community. In the end, Darius is the arbiter of what is allowed here. If you don't have a good idea of the kind of behavior that flies with Darius, again, you probably shouldn't join this instance. In the interest of specificity, we do have a code of conduct and privacy policy which you should read.

Friend Camp features several modifications that were requested by our users.

  • you can log in via any subdomain, which means you can log in to multiple accounts in the same browser session (for example, log in once on friend.camp and then as another user on alt.friend.camp)
  • they are no longer called "toots", they are now "posts"
  • if you have a locked account and you get a follow request, a reminder appears under your "post" button (on normal Mastodon mobile it is otherwise buried in a sub-menu and you might not see it for a long time)
  • the emoji dropdown is a neutral smiley face instead of the cry-laughing smiley
  • @mentions are rendered as "@user" for a Friend Camp user and "@user@domain" for remote users. This helps clear up when you follow two people who have the same username on different servers.
  • there is a "never ask me again" checkbox on the confirmation for clearing your notifications -- more info here
  • images in a CW'ed post are collapsed behind the CW. When you expand the CW, you can see the whole image immediately. more info here
  • When an mp3 link is in a post, we also embed an inline mp3 player. git commit here

Important Bit from the Privacy Docs

If you want decent privacy (the info doesn't leave this server), the only way to do that is to set your account to private, only accept friend requests from other friend.camp users, and only ever @ mention other friend.camp users. Once you start talking to people on other servers, all bets are off. Any private message you send to someone on another server could be looked at by the admin of a different server. This is kind of like email: if you are on a private email server, and you send an unencrypted email to a gmail account, congrats, Google now has the content of that email. But also, you do this every day, so, hey. The internet!

Our beautiful icon is based on photo3idea_studio from www.flaticon.com, licensed CC 3.0 BY. It has been modified by @casey@friend.camp!