Crediting your own website when syndicating to Mastodon with WordPress plugins

I’ve been tinkering around with methods to automatically syndicate (POSSE) content from my personal website to Mastodon. I’ve been working at making a custom plugin which is far from finished. But a test post I made the other day, caught a few people’s attention[1][2]

I was trying to syndicate from my website so that the post on Mastodon would credit my website for the post and link back to my homepage as the application that made the post. You’ll notice at the bottom of the post there’s the post date and a globe icon, which indicates the post is public, followed by my website name ‘BoffoSocko.com’ and details about replies, reposts, and favorites.

screen capture of a Mastodon post which gives credit to Boffosocko.com at the bottom of the post.

I assuredly won’t release a public plugin for WordPress that does this. But since some have asked how I did it, I thought I’d share some of the internals of a few WordPress plugins that one can quickly modify to achieve the same thing.

That I can currently see, there are three plugins in the repository that will allow one to syndicate content to a variety of Mastodon instances. They are Mastodon Autopost, Mastodon Auto Share, and Share on Mastodon. The first two are closely related and essentially replicate the same codebase.

Similar to using Twitter’s API to crosspost, Mastodon is looking for two bits of information when an application is registered: a client name and a website URL. 

Mastodon Autopost and Mastodon Auto Share, both have a file called client.php which define these two variables. 

public function register_app($redirect_uri) {
  $response = $this->_post('/api/v1/apps', array(
    'client_name' => 'Mastodon Share for WordPress',
    'redirect_uris' => $redirect_uri,
    'scopes' => 'write:statuses write:media read:accounts',
    'website' => $this->instance_url
  ));

You can edit this file with a text editor to change the 'client_name' from 'Mastodon Share for WordPress' to 'Anything You Want'. If you’re in a joking mood, maybe change it to 'Twitter'?

To change the URL so that the link on the client_name directs to your website, you’ll want to change the line 'website' => $this->instance_url.

In particular change $this->instance_url to 'https://example.com' where example.com would be your website. I’ll note that $this->instance_url on this line in the original plugin is a bug. If left alone, it points the URL to your home Mastodon instance instead of to the more logical https://wordpress.org/plugins/autopost-to-mastodon/ where the plugin lives. 

If you prefer using Jan Boddez‘ excellent plugin, you’ll want to do something similar, except in that case you’ll want to change a file named class-options-handler.php in the includes folder.

Here you’ll want something like:

'client_name'   => __( 'Example.com' ),

But note that Boddez doesn’t have a similar bug, so the website line

'website' => home_url(),

is already correctly defined so that your website will automatically be linked without any changes to it.

If you’re already using one of these plugins and manually modify them, note that you’ll probably need to re-authorize the plugin so that the changes propagate.

This post was originally published on Chris Aldrich

Spent a few minute to finally set up my website with Brid.gy so that it’s now pulling responses back from Mastodon. It’s so nice to see all the interactions that were once “lost” to me coming back to live with their proper contexts on my website.

For those looking to tinker with their websites as it relates to interacting with Mastodon, the IndieWeb has a reasonable number of potential options in addition to your ability to roll your own.

This post was originally published on Chris Aldrich

Welcome to the gang!

If it helps to have some company, I seem to recall Christophe Duchamp running a Mastodon instance for French-speaking IndieWeb users which he’s been documenting.

I know there are a handful of us interested in better documenting some IndieWeb pathways for those who are less technical. For a while I’ve been hacking away at some pieces particularly for WordPress at https://indieweb.org/User:Boffosocko.com/wordpress-draft. I’m sure you’ll run into many of the others as well.

was originally published on Chris Aldrich

An IndieWeb Podcast: Episode 14 A loose collective of developers and techno-utopians

An IndieWeb Podcast: Episode 14 A loose collective of developers and techno-utopians


Running time: 1h 19m 57s | Download (37.5MB) | Subscribe by RSS | Huffduff

Summary: Our first episode since January. David Shanske and Chris Aldrich get caught up on some recent IndieWebCamps, an article about IndieWeb in The New Yorker, changes within WordPress, and upcoming events.

Recorded: May 19, 2019

Shownotes

6 camps later…
Austin
Online
New Haven
Berlin
Düsseldorf
Utrecht

National Duckpin Bowling Congress
Duck Tours
Streaming rigs for remote participation at IndieWeb Camps
Ad hoc sessions (🎧 00:11:28)

Can “Indie” Social Media Save Us? (The New Yorker) by Cal Newport (🎧 00:13:50)

Swarm Account deletions and posting limits
New Checkin icon within the Post Kinds Plugin: example https://david.shanske.com/kind/checkin/
Weather now has microformats mark up in WordPress
Fatwigoo problems with icons
IndieWeb Bingo

Webmention Project

Project of updating Matthias Pfefferle‘s Webmention and Semantic Linkbacks plugins (🎧 00:26:10)

Readers & Yarns

Readers & Yarns update (🎧 00:40:50)
X-Ray
Indigenous Replacement: Final Indigenous Log: The Future of the App

Post Kinds Plugin

Post Kinds and new exclude functionality (🎧 00:48:15)

  • widgets
  • titleless posts
  • On this day

David’s list of 24 IndieWebCamps he’s attended
Looking back at past IndieWebCamp sessions and wiki pages for interesting ideas and new itches
Date and time stamps on webmentions
Call for tickets in WordPress
Subscribing to h-cards with WebSub
Is Mastodon IndieWeb?
Fixing IndieAuth
Improving scoping, particularly for multi-user sites

Coming up within the community

IndieWeb Book Club

IndieWeb Book Club is coming up featuring Mike Monteiro’s book Ruined by Design(🎧 01:13:04)

IndieWeb Summit 2019

9th annual IndieWeb Summit (Portland) is coming up in June. RSVP now.

Questions?

Feel free to send us your questions or topic suggestions for upcoming episodes. (Use the comments below or your own site using Webmention). 
Perhaps a future episode on Micro.blog?

An IndieWeb Podcast: Episode 14 A loose collective of developers and techno-utopians was originally published on Chris Aldrich

Doug, the sound of this is interesting, but it seems to be a lot harder than it might need to be, not to mention the pitfalls of being assigned emojis one wouldn’t want representing them in addition or the centralized nature of the provisioning source.

It also sounds very much like Kevin Marks’ Distributed Verification scheme using the rel=”me” attribute on web pages for which he built a chrome browser extension to actually implement it. Kevin also recently reported that Mastodon now actually supports this verification scheme in one of their most recent updates which should be used by instances that are regularly updating. The benefit is that this scheme already exists, is relatively well supported, there are parsers available for it, and it’s actually working on the open web. It’s also truly distributed in that it doesn’t rely on any central provisioning authorities that require ongoing maintenance or which could provide a monopoly on such a service.

Reply to What is Emoji ID? by Doug Belshaw was originally published on Chris Aldrich