There’s more to the Fediverse than trying to rejig your foregone twitter experience into Mastodon, indeed it is a party of distributed platforms. Given my love of photos, I’ve been casually exploring Pixelfed, the platform for photo sharing.
Not that I will ever tear away from my firm flickr love, but I was curious to see the connections and possibilities. While my main Fediverse channel is Mastodon, tooting along there as @cogdog or via the web address https://social.fossdle.org/@cogdog (a key fediverse skill is ping-ponging from @handle to URL and back).
I’d heard of Pixelfed while back, but was not seeing much to try there, until I read somewhere (in Mastodon), that one could create a Pixelfed account and login using a Mastodon account. That seemed easy to try, so I started at the main Pixelfed instance https://pixelfed.social though like Mastodon, you have different instances to plant your photos in.
Indeed I created an account on the main ship, and tossed a few pictures in.
So I am on board as https://pixelfed.social/@cogdog.
A single post is a photo, with a caption, comments, like activity, and a handy overlay of a Creative Commons license (if selected to use). Nothing exotic, but also clean (and hover shows support for alt-text). One can also make collections of your own photos (example) and there is also a new portfolio feature to highlight your best stuff.
You can make a “post “with a single photo or up to 10 together (instagram-like), and stories that vanish (ditto). It seems to aim to be more IG like than flickr. Like Mastodon, you can follow accounts on different instances, follow a local timeline of photos, or a global one. There’s nice options to choose a default license, require alt-text, and more.
So that’s all fine and easy.
Where it gets interesting, is seeing the interfediversisness in action. In Mastodon, a Pixelfed account can be followed, as I have done by searching there for @cogdog@pixelfed.social
So I will see all my photos posted to my new pixelfed account in Mastodon, see how the URLs get routed as https://social.fossdle.org/@cogdog/111298521972514097
And any replies made in Mastodon, e.g.
show up in the pixelfed post for this photo. Everything is intertwingly, connected. And it works the other way too- in Pixelfed, I can search for and follow a Mastodon account, like @judell, where I can see a representation of just Mastodon posts where Jon has uploaded an image
Perhaps this just makes your brain spin and so something like Googling recursion but I found it rather beautifully connected.
Embedding Pixelfed Posts in WordPress
Last year I added to this WordPress site some custom code to enable the auto embedding of Mastodon posts just by pasting a url on a blank line. I wanted to see if I can do this for Pixelfed URLs, so let’s see if this works for the public share link for a photo say if I enter into a blank block (or embed block) this URL https://pixelfed.social/p/cogdog/622914235908003754
Will it work?
Yes, it does! I wanted to make this so the pattern to match a pixelfed site need not be specified by a instance, so the pattern of an embeddable pixelfed URL is https://blah.instance/p/username/idstring
This is the basic code, but tweaking might be needed for CSS fit of the iframe:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
add_action( 'init', 'cdb_register_embeds' ); function cdb_register_embeds() { // handler for pixelfed wp_embed_register_handler( 'pixelfed', '#^https?:\/\/((?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9])\/p\/[a-zA-Z0-9\_]+\/(\d+)$#i', 'cdb_handler_pixelfed' ); } function cdb_handler_pixelfed( $matches, $attr, $url, $rawattr ) { // handler for pixelfed embeds $embed = '<iframe src="' . esc_attr($matches[0]) . '/embed?caption=false&likes=false&layout=compact" class="pixelfed__embed" style="max-width:100%; min-height:600px; border:0" width="600" allowfullscreen="allowfullscreen"></iframe><script async defer src="https:/' . esc_attr($matches[1]) . '/embed.js" async="async"></script>'; return $embed; } |
If it is not too flawed, I can add this to my plugin that has a few more extra autoembed goodies.
This is just a first bit of play with pixelfed… I won’t be making it a primary photo home (especially with storage limits). I also am not quite as thrilled that pixelfed strips out all photo EXIF data (done to protect location info I understand, but it could be a bit more flexible to make that a choice).
I’d also like some ability to say automatically post to pixelfed, maybe through IFTTT, say flickr photos tagged with a marker tag –I made a few feeble attempts following the approach I use to post tagged pinboard posts to mastodon but could not get pixelfed to accept the incoming request.
If anything, this has been fun to tinker with.
Featured Image: Photo by @cogdog licensed under Public Domain (CC0) — that attribution was a direct copy/paste from pixelfed, woot!
Comments