Reblog of Matthias Pfefferle: Enable Mastodon Apps

Reblog via Matthias Pfefferle

Ich war am Wochenende auf dem CloudFest Hackathon und hatte zum zweiten Mal die Change ein Projekt zu betreuen. Die Idee zu „Enable Mastodon Apps“ stammt von @alex und ich freue mich sehr, dass er mir sein „Baby“ für den Hackathon anvertraut hat!

Hier ist unser Pitch:

Hier klicken, um den Inhalt von YouTube anzuzeigen.
Erfahre mehr in der Datenschutzerklärung von YouTube.

var _oembed_068c0c63330a5645737b81421ea55b3e = ‘{“embed”:”<iframe title="Enable Mastodon Apps for WordPress and its Plugins" width="900" height="506" src="https:\/\/www.youtube-nocookie.com\/embed\/VJWdzeZz-ok?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen><\/iframe>”}’;
[data-embed-id=”oembed_068c0c63330a5645737b81421ea55b3e”] { aspect-ratio: 900/506; }.embed-youtube .embed-privacy-logo { background-image: url(https://notiz.blog/wp-content/plugins/embed-privacy/assets/images/embed-youtube.png?v=1698874221); }

Ich bin begeistert von der Idee!

Das Nachbauen der Mastodon-API stellt eine relativ einfache Lösung für das aktuelle ‚App-Problem‘ von WordPress dar. Die gängigen Apps zielen darauf ab, den Nutzern das traditionelle Bloggen zu ermöglichen. Allerdings haben soziale Medien im Allgemeinen und Twitter im Speziellen, die Art und Weise wie wir im Internet kommunizieren, maßgeblich verändert. Es geht nicht mehr um lange Artikel, sondern um kurze Nachrichten ohne Titel mit dem Fokus auf Bilder oder Videos.

Ein weiterer Nebeneffekt sind die sozialen Interaktionen wie Kommentieren (die WordPress über die letzten Jahre spärlich vernachlässigt hat), Liken, Boosten und Bookmarken (die WordPress nativ gar nicht unterstützt), welche die Mastodon Apps von Haus aus schon mit bringen.

„Enable Mastodon Apps“ stellt aber nur die Endpunkte für diese Interaktionen bereit, um sie nutzen zu können, braucht es weitere Plugins, wie z.B. Friends und/oder ActivityPub. Mehr dazu hier: Friends with ActivityPub – Deine nachhaltige Identität im Web.

Das Projekt hat mich sehr an die frühen Twitter-Jahre erinnert. Die Twitter-API galt lange als der de-facto Standard für Micro-blogging und Automattic/@photomatt hat damals schon die Vorteile für sich erkannt und die API für WordPress.com nach gebaut:

Of course one of the coolest things about Twitter right now is the client applications, particularly the mobile/iPhone ones. I use Tweetie 2 on my iPhone every day. Wouldn’t it be cool if you could get all your blog subscriptions and post to your WordPress.com blog from apps like Tweetie? Well here’s an early Christmas present…

We’ve enabled posting to and reading of WordPress.com blogs via the Twitter API. Any app that allows you to set a custom API URL will work.

Post and Read via Twitter API

Hackathon

Wir waren zwar nur 4 Personen, aber ich sag nur „Qualität statt Quantität“!

Vielen Dank @Drivingralle, @matze und @obenland, es war super produktiv und hat großen Spaß gemacht 🙂

Von links nach rechts: Ralf Wiechers, ich, Matthias Kittsteiner und Konstantin Obenland

Was wir erreicht haben:

  • Die meisten Mastodon-API-Endpunkte wurden implementiert.
  • „Hooks“ und „Actions“ für den internen Gebrauch.
  • Dokumentation aller Hooks.
  • Grundlegende Beispielimplementierungen in ActivityPub und im Friends Plugin.
  • Testen von zusätzlichen Clients.

Und hier ein paar Statistiken von den zweieinhalb Tagen:

  • 3 new contributors to the plugin
  • 4,101 lines added
  • 911 lines removed
  • 213 commits
  • 34 files changed
  • 25 PRs merged
  • 7 PRs almost merged
  • 0 Social Media posts

Und hier der Pull Request in seiner ganzen Pracht: Collection of changes from the CloudFest Hackathon

Vielen Dank auch an @bart und das Team von Mammoth, die uns im Vorfeld unterstützt haben. Mammoth funktioniert jetzt wunderbar mit WordPress und Alex und ich hatten einen Einblick in die App-Entwicklung und deren Eigenheiten 🙂

Hier ein paar Bilder:

The Beauty of Simple Bookmarklets

Jeremy Keith posted about bookmarklets that he uses for testing websites where he specifically likes those that just pass on the current URL to a service. Those bookmarklets typically have a structure like:

javascript:location.href='https://example.com?s='+escape(location.href)

I use those for my Friends WordPress plugin, too. That’s the one where you can follow people via RSS or ActivityPub and see the feed in a private section of your blog or even in Mastodon apps.

A screenshot of my WordPress tools section.

So, to follow the current website, you’d click on a bookmarklet like this:

javascript:location.href='https://example.com?add-friend='+escape(location.href)

I have another WordPress plugin called Post Collection, where you can save articles to your blog. Both to be able to search them later, or, with my Send to E-Reader plugin, to send them to your favorite reading device as a compiled e-book with chapters. Although the bookmarklet that you’d typically install has some logic to post the whole current page body so that it also works on non-public posts, there is also a version that looks like this:

javascript:location.href='https://example.com?user=123&collect-post='+escape(location.href)

One particularly nice thing about these style of bookmarklets, is that while unfortunately they don’t (or didn’t?) work on Firefox Mobile, you can use an Android app called URL Forwarder to share a URL from any other app which comes in quite handy when you use other apps to discover interesting content (such as awesome the Glider app for Hacker News).

I have only added my two bookmarklets here, but most of the ones Jeremy mentioned could also be added.

By the way, I have some history with bookmarklets. In 2005, I created a bookmarklet manager called Blummy. It’s still alive but dormant (ping me if you want to try it, signups have been spammed to death).

Bookmarklets have come out of fashion but were very important back then. I wished browsers would support them better and make installing them a little less awkward. They are always like a little swiss army knife to me.

Posted in Web