After far too long, I finally launched support for importing multi-photos from Instagram via OwnYourGram!
I had to make a couple tough calls, which I'm not entirely happy about, but I think it's an acceptable compromise for now. The main limitation of the way it currently works is that Instagram posts that mix photos and videos in the same post will import the videos as just their poster frame. Additionally, you can tag people in the individual images on Instagram, but when that's converted to a Micropub request and sent to your site, the person tags are combined into one list associated with the main post.
The reason for doing it this way is there were already several websites and Micropub implementations that support the "multi-photo" concept, but very few that support "collections." The difference is a multi-photo is a single h-entry that has multiple photo URLs, whereas a collection is an h-entry that contains multiple h-entrys inside of it. The collection concept allows a much richer representation of things, since you can have a collection containing photos, videos, or anything really, and each h-entry within the collection can have its own tags, person-tags, etc. There are some more notes on the advantages and limitations of each on the IndieWeb wiki.
But right now, there are very few implementations of collections at all, and as far as I know, nobody's Micropub endpoint supports creating collections anyway. In contrast, there are several examples of multi-photos along with support in Micropub endpoints, including recent support for it in micro.blog. So that's a compelling argument for making OwnYourGram support the simple case first, and eventually I'll see about adding support for full collections later.
Since not everyone's site supports multi-photos, I decided that for all existing OwnYourGram users, I would maintain the existing behavior where it only posts the first photo to your site. This way I avoid surprising people with a new kind of Micropub request. If you're an existing user and want to accept multi-photos, then you just need to be prepared for the "photo" property to be an array, and you can enable multi-photo support in the settings. New users will have this enabled by default.
I talked about this upcoming change on episode 1 of my new microcast "Percolator," so please subscribe if you're interested in following along with other developments I'm thinking about!
Looking forward to seeing some multi-photos on all your websites!
Today I added an option to OwnYourGram to opt in to receiving an h-card as the location property instead of a geo:// URI. On the dashboard, there is a setting to toggle between receiving a geo:// URI with file uploads, and an h-card location with a reference to the Instagram photo URL.
Since Micropub's form-encoded format doesn't support nested objects like h-card, we have to use the JSON format to send that. However in JSON format, we can't upload files, so we need to send just the image URL. Typically, a Micropub client would first upload the photo to the user's Media Endpoint and include the resulting URL in the JSON Micropub request. However since the photo already exists at a URL on Instagram's server, I just skipped the extra upload step and pass the endpoint the Instagram URL.
So if you want to start receiving the location as an h-card, you can opt in to this change on the OwnYourGram dashboard!
Today I added some additional settings to OwnYourGram. You can now configure a whitelist and/or blacklist of keywords to control which of your Instagram posts are imported to your website.
I've been posting my #100DaysOfMusic posts on Instagram and having OwnYourGram post them back to my website, but over the past week I've found some problems with that approach. Instagram videos are limited to 60 seconds, and one of my songs was 90 seconds long. Instagram also runs some pretty heavy compression on the audio, which seems to be optimized for speech, so the music doesn't come through as cleanly as I wanted.
Because of this, what I've been doing is replacing the video on my website after OwnYourGram does the initial import. This workflow ends up being way too complicated, so what I'm going to start doing instead is posting the videos to my website directly. However, I still want to share them on Instagram, but I would end up with OwnYourGram posting another copy of it back to my website.
With the new blacklist setting, now I can blacklist the "#100DaysOfMusic" tag so that OwnYourGram will skip importing those videos. While I was at it, I also added a whitelist in case someone has a use case for that as well. You can use the whitelist and blacklist together to make a rule that imports photos matching a keyword as long as another keyword is not present.
I'd love to hear if you end yup using either of these settings!
Previously, OwnYourGram would check all users' Instagram feeds once an hour. I changed it to have four polling tiers, and the interval for the top tier is every 15 minutes now. This means people who post lots of photos will now see their photos on their site sooner, and because of the tiered approach, I won't be wasting resources on feeds that post infrequently.
The four tiers are:
Users are sorted into tiers based on the number of photos posted in the last 14 days. The more you post, the more often OwnYourGram checks your feed! If your Micropub endpoint returns an error, then you're bumped down a tier. If you're at the lowest tier and there's an error, then polling will be disabled completely until you log back in.
Thanks to snarfed for suggesting the tiered approach!
I finished two updates to OwnYourGram today.
There is a new page when you log in where you can see a list of your 20 most recent photos on Instagram, check whether they've been posted to your website already, and re-post any if you need to!
This is helpful in case that OwnYourGram somehow misses importing any of your photos, or if your Micropub endpoint temporarily returns an error, or when you're initially developing your endpoint and need to test posting photos and videos to it repeatedly.
I also added a "disconnect Instagram" button to the dashboard so you can disassociate your Instagram account if you need to stop importing photos or move to another website.
OwnYourGram is starting to feel much more like a real tool now, and not just a little web wrapper around a cron job!