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

Replied to Proposing a Microformats2 Markup for Licensing Information by Jamie TannaJamie Tanna (Jamie Tanna)
Some recommendations for how to mark up licensing information with Microformats, for making license information machine-discoverable and machine-readable.

Great write up Jamie. Some interesting things to think about and lots of useful examples.

I suspect that for most personal websites the idea of fair use will give people enough protection for reply contexts. Of course it will depend on their jurisdiction as fair use can vary by country or potentially even within countries in terms of how it is applied.

I would almost have to think that barring particular legislation and precedent that people/companies who are explicitly providing Open Graph Protocol or similar meta data on their websites are explicitly granting a license to use that content as the only use for that data on most systems is to provide it for creating contexts on services like Facebook, Twitter, etc. Facebook likely created OGP as a proprietary format to give itself broad legal protection for just such use cases, though I suspect they parse pages and take titles or other snippets when OGP doesn’t exist. Naturally some large systems like WordPress may push OGP into code without the site’s owners being aware of what they’re potentially giving away, so the area is really murky at best. It would be beneficial to consult an attorney to see what their best advice might be or if there are precedents with respect to these areas.

For future reference, here is the relevant section for Fair Use from Title 17 of the Copyright Law of the United States:

107. Limitations on exclusive rights: Fair use40

Notwithstanding the provisions of sections 106 and 106A, the fair use of a copyrighted work, including such use by reproduction in copies or phonorecords or by any other means specified by that section, for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright. In determining whether the use made of a work in any particular case is a fair use the factors to be considered shall include—

(1) the purpose and character of the use, including whether such use is of a commercial nature or is for nonprofit educational purposes;

(2) the nature of the copyrighted work;

(3) the amount and substantiality of the portion used in relation to the copyrighted work as a whole; and

(4) the effect of the use upon the potential market for or value of the copyrighted work.

The fact that a work is unpublished shall not itself bar a finding of fair use if such finding is made upon consideration of all the above factors.