Experiments with Instagram and WordPress

Experiments with Instagram and WordPress #IndieWeb #Manual #POSSE

[exif id="32699"]

Earlier this year I started using an Adobe Lightroom plugin to export my images directly to Instagram. I also use an Adobe Lightroom to WordPress plugin from Automattic to export images directly to my self-hosted Jetpack-powered WordPress.

It’s a two-step manual process but made easier by the efficiency of getting the images online.

However, neither post was connected to the other. Once I learned about syndication I started perusing the IndieWeb website to find ways to connect images I posted on my website with images I posted on Instagram (or elsewhere). I experimented with a few of these methods.

As a minimum setup for some of these solutions I enabled and configured the following list of plugins:

OwnYourGram

OwnYourGram is a web service that polls your Instagram account, converts your posts to a Micropub request and sends them along with photos to your Micropub endpoint.

I installed the Micropub and IndieAuth plugins for WordPress. IndieAuth is a way to use my own domain name to sign in to websites by linking my website to one or more authentication providers. I setup my website to use IndieAuth, linked it to Twitter, and then I signed into OwnYourGram with my domain.

Once logged into OwnYourGram, I configured the hashtag that would trigger the import and automatic syndication of my post back to my website.

I posted a photo on Instagram and waited. And waited. I did not test how long it took but OwnYourGrown did not post to the website in real time. Growing impatient I manually triggered OwnYourGram. The resulting post had a randomly generated numeral permalink, a randomly generated post date of 31st December 1969, an image in the body instead of the featured image, and badly formatted text, and the post title was blank.

I care about how stuff looks on my website. I care enough that OwnYourGram isn’t the solution for me. For OwnYourGram to be a viable solution for me, I would want the image to be attached to a featured image, Instagram hashtags as WordPress tags, and a URL that was more meaningful.

freedom.io

Another web service that was mentioned on the IndieWeb website was freedom.io. However, when I visited the website I got the following:

This was an app that copied your posts, pictures, and other content from Facebook, Twitter, and Google+ to a blog of your choice. It's down now, but it's open source. So long, and thanks for all the fish!

A link to the source code was provided. I am will not explore this solution further.

Single Photo Bookmarklet

The Single Photo Bookmarklet by Tantek Çelik is a web browser bookmarklet that will extract the Instagram permalink, image URL, image caption and copy them into a text note. I can then create a WordPress post and paste that information into the appropriate fields. It’s a fully manual process.

The bookmarklet works but provides a square formatted image only. This solution useful if you post Instagram infrequently and don’t mind the pain of using a mobile browser to create WordPress posts. If your posts to Instagram frequently this might not be the solution for you.

I didn’t pursue this solution further since my process already involves manually re-creating Instagram posts after creating the original on my website.

DsgnWrks Instagram Importer

I think DsgnWrks Instagram Importer is the solution that Chris Aldrich uses. The plugin allows the user to import Instagram photos to a WordPress site with options to control the imported posts formatting including built-in support for WordPress custom post types, custom taxonomies, post-formats.

But it doesn’t work with WordPress 4.9. and hasn’t been updated in 8 months. I usually don’t run untested code to reduce the likelihood of introducing security vulnerabilities. If a plugin has not been tested on the current (or at least the previous) release of WordPress or hasn’t been updated in a long time, I don’t use it.

But I wanted to see if/how this plugin worked. It didn’t. After trying unsuccessfully for about an hour trying to get the plugin to connect to my Instagram account I visited the plugin support page. Another user has reported that Instagram tokens were being rejected and that the plugin no longer works.

The UI allowed me to authenticate to Instagram. I was able to set the import options. However, once I clicked save, the user tab disappeared from the UI. Changing the import options from manual was not possible. The UI resets.

Installed the DsgnWrks Instagram Importer Debug plugin to help with troubleshooting but was not able to get that to do anything useful and the plugin kept disabling itself after use.

I gave up and moved on.

SNAP Pro

Social Networks Auto Poster {SNAP} from Nextscripts seemed the most promising. This basic WordPress plugin creates syndicated posts to various services including Twitter, Facebook, LinkedIn, Medium, Flickr, etc. and leverages the Bridgy Publishing plugin to link back to the original post on WordPress.

There is a lot to like about SNAP. However, to take advantage of some of the features, including the ability to post to Google+, Pinterest, Instagram, YouTube, Flipboard, etc. purchase of a ($49.95/year) Pro subscription is required. So I did.

It has a number of advanced features including:

  • Scheduled and Delayed posting
  • Filters for posting to each service based on categories, tags, types, etc.
  • Leverages Webmentions to auto-import comments and likes from Instagra, Facebook anf Flickr, and replies and mentions from Twitter as WordPress Comments
  • Post formatting, etc.

It took some tweaking but for a while, I was very happy with the results. And then recently the SNAP Pro service starting having problems posting to Facebook. And then Instagram. Until the issues with Facebook and Instagram are resolved, this solution is dead to me. I have given someone money for a service which I can’t use. Which to put it bluntly, fucking pisses me off.

Keyring Social Importers

Xavier Roy suggested I try using the Keyring Social Importers plugin. This plugin supports a set of social importers that pull in content created on other sites and re-publishes it on your own WordPress site. After an initial import, the importers optionally check each hour and automatically download new content. New posts are created for each item imported with support for specific Post Formats, depending on the content type.

At the time of writing this, the plugin had not been tested on WordPress 4.9. The untested code can be unstable code and unstable code can lead to security leaks etc. so I configured and tested everything on a test instance of WordPress.

I had to also install the Keyring plugin to use with Keyring Social Importers which provides the authentication and API connections to each of the external services. I configured API access to Instagram and then from the "Tools->Import" section of the dashboard I clicked the link to start importing from Instagram.

I've had my Instagram account for just over a year. The importer bombed after importing the most recent Instagram posts but I was able to restart the importer which continued in the background. Each photo on my Instagram account was downloaded and imported into myMedia Library. The imported image was attached to each post as a featured image, which is a feature I wanted, however, each image is only 640px × 479px. I would have preferred to import the 1080 version of the image. I know Instagram support this. The body of the post was set thusly:

<p class="instagram-image"><a href="https://www.instagram.com/p/Bc0Hw30HlOS/" class="instagram-link"><img src="http://104.236.216.66/wp-content/uploads/2017/12/25006240_1693035707385550_7011669385009954816_n.jpg" width="640" height="479" alt="You know what? Sometimes you don’t even need the bandanna.

@troonbrewing Crust Punk Dog is a New England style IPA.

#troonbrewing #crustpunkdog #ale #beer #craftale #ipa" class="keyring-img" /></a></p>
<p class='instagram-caption'>You know what? Sometimes you don’t even need the bandanna.

@troonbrewing Crust Punk Dog is a New England style IPA.

#troonbrewing #crustpunkdog #ale #beer #craftale #ipa</p>

All of the Instagram hashtags were imported as WordPress tags. The importer leverage the Post Kinds and Simple Location IndieWeb plugins to set the Post Kind to Photo and set the geographic location for the post. However, syndication links were not set. That means setting it manually later. I am also disappointed that the entire content of the Instagram caption was used as the title of the post. It's ugly.

The original Instagram post is neat and tidy. The WordPress copy is not.

Keyring Social Importers Instagram Import

My (mostly) Manual Solution

My original workflow involved creating a separate post on my website and on Instagram. But since I started using the IndieWeb and Syndication Links plugins I have adjusted my workflow. For my new workflow, after creating a photo post on my website, I manually post the photo to Instagram, then I copy the Instagram URL and add it as a syndication link on the original WordPress photo post.

  • Original post: https://islandinthenet.com/tired-chasing-perfection/
  • Instagram post: https://www.instagram.com/p/BcmgMfKnN1q/

It’s not an ideal solution but for me, it works better than the other solutions I tried. Ideally, if Nextscripts could fix the problems with SNAP Pro I would switch to that but the cost of the annual subscription is also an issue.

As I stated in an earlier post:

I’m going to use what works and is easy but focus on my content. When it doesn’t work; when it’s not easy. I’ll move on. Try another time.

Montgomery Township, New Jersey, United States of America

Author:Khürt Williams

A human who works in information security and enjoys photography, Formula 1 and craft ale.

15 thoughts on “Experiments with Instagram and WordPress”

  1. Hi again Khürt, a couple comments about your experiments with Keyring:

    Keyring (and the importers) are definitely tested up to the latest WordPress version. I actually run both on my site, which runs the trunk of WordPress, so I tend to find out pretty quickly if things break.
    What are/how do "Syndication links" work? Or how were you expecting them to work? The Importers all store a fair amount of metadata for each thing imported, along with the raw data from the API where it came from. We should be able to get that fixed pretty easily.
    RE: the formatting of the post -- that's largely up to the theme that you're using, which is part of what makes developing plugins like these so complicated for WordPress. I ended up deciding the put the comment in the title and the content to try to handle all situations, but at some point I'd like to ship the importers with some concept of a lightweight templating system of their own, or some other way of making it easier for the site owner to define how they'd like to import the different pieces of information available.

    Cheers.

    1. Hi Beau,
      When I wrote this I was using some old versions of this code I found in a plugin on the WordPress repository. I don't see these issues with any themes with the "newer" code.

  2. Pingback: Khürt Williams
  3. Pingback: Chris Aldrich
    1. While that's possible, I wouldn't recommend tweaking the actual code, because then it's going to break every time the plugin is updated.

      You could consider modifying your theme, or having a child theme that just doesn't output the title on these specific posts. Of course if you modify your theme, you end up with the same issue of handling updates.

      I thought I had some filters in there that would allow you to change this sort of thing, but I've just looked and it turns out I don't. Oops. Seems like the best I have currently is the keyring_post_imported action that's fired at the end of each imported post, which allows you to then act on that post (e.g. and remove its title). https://github.com/beaulebens/keyring-social-importers/blob/master/importers/keyring-importer-instagram.php#L341 That is passed the slug of the service, so you could hook into it and only remove titles on posts imported from instagram.

      I created this issue to track ideas for allowing for better filtering before importing content. https://github.com/beaulebens/keyring-social-importers/issues/17

      Cheers.

      1. Hi Beau,
        I decided it was better to push my images to Instagram instead of pulling them from Instagram. Why? I like displaying the EXIF and IPTC data from my images. Instagram strips that information from the images.

        I have read (and re-read) the documentation for Keyring and Keyring Social Importers and I am poking around the code. I am hoping I can write an importer for Untappd. Currently, I am using Zapier to push my Untappd check-ins back to my blog. It works but I think Keyring Social Importers offers a better (and more controllable) path.

    1. Hi Xavier,

      I have not tried the Keyring Social Importers plugin on my main website. The code has not been tested on WordPress 4.9 and untested code can be unstable code and unstable code can lead to security leaks etc. I'll give it a go on my test instance of WordPress and update this article.

      View on

  4. ugh. sorry you had so much trouble! thanks for writing it up.

    publishing to Instagram from third party apps is difficult and often broken precisely because Instagram wants it that way: http://developers.instagram.com/post/133424514006/instagram-platform-update

    they allow a very short list of use cases in their API, and this isn’t one. services like SNAP reverse engineer their apps and scrape their HTML. IG doesn’t even want apps reading photos or feeds, so Bridgy and OwnYourGram scrape too, which is obviously brittle, and heavily rate limited. sad.

  5. Pingback: Marty McGuire

Comments are closed.