I've been tracking my location since 2008, and write down everything I eat and drink. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel.
Today I wrote up documentation on OwnYourSwarm. It actually took quite a bit longer than I expected to write everything up. The documentation walks through each component:
Rather than repeat any of the information here, I will just send you off to read the docs! Please let me know if you have any questions! I hope to see some more implementations of people receiving checkins via Micropub soon!
I'm pretty excited to say that OwnYourSwarm is now backfeeding likes and comments from Swarm checkins!
Thankfully, the Foursquare API is well documented, and has quite reasonable rate limits. It also seems to have a well-documented change policy, so is unlikely to arbitrarily change out from under me. I'm hoping this backfeed feature will be relatively stable.
Like bridgy, I implemented proxy pages for individual likes and comments on Swarm. The page is marked up with h-entry, and includes the author name, photo, URL, as well as the comment text. Swarm also has the ability to send "sticker comments", which I render as an <img> tag in the comment body.
Regular comments look like you'd expect.
Likes look similar, and have fallback text in the comment body.
I took advantage of specific behavior I've seen on my checkins in order to build a polling schedule that won't overload my server. For the most part, people only like and comment on recent checkins. After a couple days, a checkin is unlikely to get any new comments.
When a new checkin is posted, the user's polling interval is reset. OwnYourSwarm will check for new responses after 30 seconds. If none are found, it will wait 60 seconds, then 2 minutes, 5 minutes, 30 minutes, 1 hour, then finally a few more long-term tiers: 1 day, 2 days, 7 days, 14 days, 30 days. Of course as soon as you post a new checkin, your polling interval will be reset to 30 seconds and will start the cycle over. This hopefully will provide a good balance between quickly sending feedback for recent checkins, while also finding feedback on older checkins as well.
The nice thing about the Foursquare API is they provide an endpoint for retrieving the last N checkins for a user, and the data returned includes the number of likes and comments. This means I only need to hit one API endpoint to retrieve the last 100 checkins and can tell if there is new activity on any of them. I then make another API request to retrieve the checkin details only when there are new comments.
OwnYourSwarm will now send webmentions for all the coins that Swarm awards to your checkins!
Here's a checkin on Swarm:
Here's how it looks on my website:
OwnYourSwarm creates a web page for each coin award on your checkin, then sends a webmention to your post!
Here's what one of the comments above looks like on the OwnYourSwarm web page:
Of course it's marked up with the Microformats2 h-entry, so that my website can parse out the icon, text and number of coins!
To get my website to recognize the number of coins awarded, I used a vendor-specific Microformats2 property, "p-swarm-coins". Based on the recommendations for vendor-specific properties in Microformats2, I chose the prefix "swarm" and the property "coins".
Now I'm excited about getting points on Swarm again!