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.