Automating syndication of reply contexts in Twitter Cards using OGP metacrap and plugins in WordPress

A Metacrap Problem

It’s metacrap–I know, I know–but I’ve been thinking about easy ways to use Open Graph Protocol meta data to add contextual Twitter cards to some of my content when syndicating posts to Twitter. My goal is to leverage the speed and ease-of-use of Micropub clients while doing as little as possible manually, but achieving as much parity between posts on multiple sites. 

I’m particularly keen to do this to syndicate/share more of the articles I read and post about on my site without adding additional manual work on my own part.

Outline of Some Resources

The Post Kinds plugin for WordPress parses URLs for me and pulls in data to create reply contexts for a variety of posts like bookmarks, reads, watches, listens, etc. Since Post Kinds doesn’t display featured images (yet), I’ve also been using the External Featured Image plugin to display the featured images from the original to add to the reply context of my posts as well. 

In addition to all these I’ve been using the All in One SEO plugin to easily add an SEO layer to posts without having to do much thinking about it. AIOSEO recently upgraded their UI and features in the last year, and yesterday I upgraded to the newest v4.0+. One of the new features it’s got is the ability to add default fields or pull in pre-existing custom fields to output OGP meta data. 

Start of a Solution

So I got the idea that since Post Kinds and External Featured Image plugins are pulling in and displaying the sort of data I’d like to show in Twitter cards, I figured why not use them? While metacrap is a DRY violation, the fact that it’s automated for me and is based on data I’m actually showing visually on my website makes it feel much less dirty. It also has the benefit that it helps make some of my syndicated content look and feel on Twitter, more like it does on my website. This is also a problem since Twitter hampers how much data I can syndicate in a single post.

I’ve still got some issues about how to deal with the Post Kinds data, but after a bit of digging around, I discovered the image URL for External Featured Image plugin is hiding in the _dcms_eufi_img field. So I can make the default Twitter settings in AIOSEO pull the external image by setting Default Post Image Source to Image from Custom Field and set the Post Custom Field Name to _dcms_eufi_img

Since a lot of my posts are reads, bookmarks, etc., this works well, but I can easily override the settings for articles or other custom posts which I make less frequently. 

Hopefully I can figure out the settings for Post Kinds to get the rest of the default fields to map across. I’m happy to hear ideas on what field names I’d need to use to get the Post Kinds Name and Summary/Quote fields to map over for the og:title and og:description respectively. Ideally I can manage to get it done without needing to get a subscription to the pro version of AIOSEO which also has support for custom taxonomies which is how Post Kinds works.

Since my theme has relatively solid microformats support, and I have plugin infrastructure to allow easy syndication from my website to Twitter through micropub clients, this last bit for creating Twitter reply contexts helps close some of the loop for me in my syndication workflow while keeping as much context across platforms.

Example

Here’s a visual example of a native post on my site and the corresponding syndicated copy on Twitter. There are some differences, mostly because I don’t have as much control of the appearance on Twitter as I do on my own site, but they’re about as close as I can get them with minimal work.

screen capture of a tweet with my thought at the top and a Twitter card underneath it including the reply context of the article I'm responding to

screencapture of a read post on my website for a Slate article with a reply context at the top and my response to it just below

Liked a post by David ShanskeDavid Shanske (david.shanske.com)
WordPress allows for custom archive templates. For the longest time, I’ve wanted to change the archive for my photo posts to show them in a photo grid. So, I’ve now done that at /kind/photo. You have to click the photo to see the full context, but I like the presentation of all photos I’ve posted. This does not include photos in other types of posts, but it’s probably the most visual item I’ve put out in a while. I hope it causes me to post more photos.
Replied to a tweet (Twitter)
The original Press This spun itself off as a stand-alone plugin, so look there first to recreate its functionality. If that doesn’t suit, try David Shanske’s Post Kinds plugin which incorporates a lot of Press This functionality and extends it quite a bit. You can create bookmarklets with it that work well (including mobile).

Another option is Tom Critchlow and Toby Shorin’s Quotebacks which you might leverage though they won’t necessarily create new posts on your behalf.

If you’ve got some programming experience, you might be able to do something interesting with a set of bookmarklets I just made too.

I think I’ve also shared most of my documented workflow for using Hypothes.is for some of this too, though that may require some work on your behalf.

Another good option is to add Micropub functionality and use some clients like Quill, Omnibear, or others in conjunction with the Post Kinds plugin. I think Quill may also have some useful bookmarklets you can use with it as well.

Feature request: Recent Kinds Widgets and/or Now page aggregation

Filed an Issue Post Kinds Plugin for WordPress (GitHub)
adds support for responding to and interacting with other sites using the standards developed by the Indieweb Community - dshanske/indieweb-post-kinds

Recent Kinds Widget

It’s a reasonably frequent design/functionality pattern to see widgets from social media services. (Goodreads is an example that provides a widget for recent reads. Twitter does so for notes. There are countless others.) 

In an IndieWeb world, it would be nice to highlight what one has recently read, watched, or listened to (as examples). Towards this functionality, it would be nice if Post Kinds could provide the ability to add widgets for a variety of the post kinds to sidebars or footers.

As a baseline I could envision each widget having:

  • a configurable title (“Recently read”, “Food diary” for eats & drinks, “Microblog” for recent notes, bookmarks, etc.)
  • a chooser for one (or more) of the many various (enabled) kinds
  • a variable N to allow for display of the N most recent of the chosen kinds; 5 or 10 might be a reasonable default; a time-based variable to run across the post within a recent period (days, weeks, months) might be a an interesting alternative as well

For display of a single kind, the widget might default to displaying:

  • a heading made of the post kind icon along with “Recent [Post Kind Name plural]”
  • Response Property Name (wrapped with the original permalink if it exists) by Author name (if it exists)
  • An optional published date for the original content (if it exists) or the date the site owner published the post kind (if it exists) (the original content date would be better for context, I think)
  • A fleuron () or hash (#) which could be wrapped with the permalink of the original Post Kind post.

UI example: 

 

If the chooser in the widget allows for displaying multiple kinds at the same time, then one could have a widget for “Recent Media Consumed” or for displaying a sidebar microblog that could include Notes, bookmarks, reads, etc. (Making it similar to embedding one’s Twitter feed into a sidebar.

For encouraging outside consumption, the widget could also have a small RSS icon with a link to that Kind’s (or Kinds’) feed.

Naturally there could be some configuration for reasonable display defaults for some of the various Post Kinds./

Now archive page

Given some of the potential similarity of the widget work above, it would also be fun to have Post Kinds generate an archive page that shows by kind either the N most recent posts for each kind or all the posts within the last M days, O weeks, or P months.

This could be used to automatically generate the idea of a Now page that gives a quick overview of what a person has been up to over a relatively recent time period. A month of posts would be a good default.

One might also be able to use a solution like How to Add WordPress Widgets in Post and Page Content as a means of embedding the widgets into such a Now-type page, which could give the user the ability to pick and choose which order to place the particular kinds into based on the site owner’s discretion.

Eight: Data types and Structure

There’s lots of data I want in my commonplace: likes, bookmarks, things I read, annotations, notes, quotes, watches, listens, etc. 

I implement them with Post Kinds Plugin to provide both structure, presentation, and context to most of my notes.

#HeyPresstoConf20


Each post can have its own category and tags for a variety of taxonomic and (most importantly) search purposes.

 

Replied to a conversation thead by @helenhousandi @boogah @jasontucker @courtneyengle (Twitter)
I think Post Formats didn’t go far enough. I love Post Kinds Plugin for extending the idea, particularly into some of the UI one sees in the social space. It also has extensibility to allow new formats as well as customize-able display, so if you want an annotation display or a “chicken feed” (just to demonstrate the point) on your site, a few modifications and you’re off to the races.

The UI part that often bogs down the posting process is the complexity of Gutenberg or the myriad of meta-boxes. To remedy this I try to pair one of the many Micropub clients (I like Quill or Omnibear as flexible examples) for posting to my website and then allowing Post Kinds to handle the rest for creating reply contexts and posting the minimum necessary metadata.

Add Post Kinds fields to WordPress Search

Filed an Issue dshanske/indieweb-post-kinds (GitHub)
adds support for responding to and interacting with other sites using the standards developed by the Indieweb Community
I’ve noticed that the built-in WordPress site search is generally abysmal because so much of the content of my site is handled by Post Kinds and the search doesn’t look through any of the common Post Kinds data fields. 

As an example, trying to search for watches of particular television shows I know I’ve watched don’t show up because I leave those post title-less and don’t specifically tag them.

Is there something in the codex that will allow you to hook these fields into WP’s internal search?

Hypothes.is annotations to WordPress via RSS

I created a video overview/walkthrough of how I take highlights and annotations on Hypothes.isHypothes.is and feed them through to my WordPress Website using RSS and IFTTT.com.

I suspect that a reasonable WordPress user could probably set up a free Hypothes.is account and use the RSS feed from it (something like https://hypothes.is/stream.atom?user=username) to create an IFTTT.com recipe to post it as a public/draft to their WordPress website.

My version presented here has also been augmented by also using the Post Kinds Plugin to which I’ve manually added a custom annotation post type along with some CSS for the yellow highlight effect. These additional coding flourishes aren’t absolutely necessary for those who just want to own the data on their website.

If you want to get even fancier you could also do RSS to IFTTT to do a webhook post to an Micropub endpoint or custom code your own solution using their API. Lots of options are available, the most difficult part may be knowing that something like this could even be done.

SEVEN

Another plugin I love is Post Kinds Plugin (Classic editor only at present) which automatically parses URLs I want to reply to, like, bookmark, etc. and saves the reply context to my website which helps prevent context collapse. My commentary and notes then appear below it.

(I also use a plugin that saves the content of URLs on my site to the Internet Archive, so I can reference them there later if necessary.)

Replied to One Avatar To Rule Them All by Terence EdenTerence Eden (shkspr.mobi)
Someone took a nice photo of me recently. I'd like to use it as my avatar photo everywhere to present a consistent image. This is not easy to do. I've had to manually change it on a dozen different Slacks, a bunch of social networks, a few forums, all my email accounts, and I'm still not done. I jus...
Gravatar has some not-so secure issues relating to privacy that allow reverse lookups which isn’t good and could potentially leak information people don’t necessarily want to release.

My favorite solution to this problem and a few related others (like updating my bio and where you can find me on social media) is the meta data route using something like Microformats. Since I provide an h-card on my website’s homepage, it should be relatively easy for any service to take my URL as my identity (rather than one of my thousands of email addresses) parse my page and find my name, photo, bio, etc. and display them.

Nearly every social silo on the planet wants all of these details, so why should I need to incessantly have to input them manually much less keep them up to date? And I’ve yet to see a social service in the wild that hasn’t asked for my URL, so it’s obviously pretty universal.

Jeremy Keith‘s Huffduffer is a great example of something that already uses this data nicely. It doesn’t pull in my photo (though I think at one time he did have a set up that would poll Flickr avatars?) or my bio, but the “Elsewhere” section of my Huffduffer account lists where you can find me on dozens of social media accounts as well as my own websites. Huffduffer can do this because I gave it my domain name and the service parses my page looking for the rel="me" tags on my homepage. It could easily pull in my other provided data.

Incidentally Kevin Marks has also proposed a distributed verification system (remember the problem that Twitter had of attempting this?) that uses the rel="me" idea.

I’ll note that my own website will parse yours to pull in the author name, URL, and avatar to display a reply context for this response on my website! So hooray for microformats! (Though I’ll note that I did modify them a tad for my own idiosyncrasies.) My site does this with David Shanske‘s excellent Post Kinds plugin uses Parse This, which parses for microformats, JSON-LD, and then, if nothing is found it falls back to Open Graph Protocol. He’s been extending it lately to cover a handful of the bigger snowflake services like YouTube, IMDb, etc. to cover some additional edge cases that don’t have good mark up. Incidentally Aaron Parecki has a version of something like this called X-ray, which he uses for various things including microsub readers, not to mention the variety of other parsers available.

I’m sure there may be other versions of this in the wild, but it would be cool to see more social services provide functionality like this.

Read The Truth about the Post Kinds Plugin by David ShanskeDavid Shanske (david.shanske.com)
WordPress has the concept of post types, which are custom content types. The post type, which is the default type in WordPress, is a post of type post. Custom post types are also used to store attachments, menus, revisions, etc…all sorts of things that aren’t traditional posts. Post Kinds as imp...
Read UTC is Enough for Everyone, Right? by Zach Holman (zachholman.com)
Programming time, dates, timezones, recurring events, leap seconds... everything is pretty terrible.
The common refrain in the industry is Just use UTC! Just use UTC! And that's correct... sort of. But if you're stuck building software that deals with time, there's so much more to consider.
It's time... to talk about time.

As programmers, we’re kind of inherently built to want the ABSOLUTE BEST HIGHEST FIDELITY FORMATS OF ALL TIME. Like dammit, I need the timestamp down to the micromillinanosecond for every cheeseburger that gets added to my bespoke Watch-The-BK-Throne app. If I do not have this exact knowledge to the millisecond of when I consumed this BBQ Bacon WHOPPER® Sandwich From Burger King® I may die. 

I totally want this as a Post Kind on my website now!
Annotated on March 03, 2020 at 07:28PM

Read Identifying Post Kinds in WordPress RSS Feeds by Dan Q (danq.me)
I use the Post Kinds plugin to streamline the management of the different types of posts I make on my blog, based on the IndieWeb post types list: articles, like this one, are “conventional” blog posts, but I also publish notes (which are analogous to “tweets”), reposts (“shares” of things I’ve found online, sometimes with commentary), checkins (mostly chronicling my geocaching/geohashing), and others: I’ve extended Post Kinds to facilitate comics and reviews, for example.
I’m sort of hoping that feed readers will improve with respect to titleless posts and make hacks like this one unnecessary. Though it could be an interesting tidbit until then.
Liked Planning out the Next Generation of Post Kinds by David ShanskeDavid Shanske (david.shanske.com)
I’ve been working on the Post Kinds plugin for several years now. It allows the enhancement of WordPress posts into the Indieweb types of posts. But in the current environment, the question I keep getting asked is: When will it support Gutenberg, the WordPress block editor? This is something of a ...
I’m thinking about this. Will try some diagrams first…