58°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • Day 95: Backfeeding Comments and Likes from Swarm #100DaysOfIndieWeb

    March 25, 2017

    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.

    Portland, Oregon
    Sat, Mar 25, 2017 10:45am -07:00 #100daysofindieweb #ownyourswarm #swarm #backfeed
    3 replies 2 mentions
    • Aaron Parecki aaronparecki.com
      haha thanks! fwiw I did try to dig into the bridgy source code to style the permalinks, but I couldn't figure out how to do it because of the way the templates are created from just concatenating strings.

      If you were to change the template generation to something like a string containing the HTML with placeholders like %timestamp% %author_name% etc, I would happily send a PR with new markup and styles!
      Sat, Mar 25, 2017 5:35pm -07:00
    • Ryan Barrett snarfed.org

      oh and i admire that you fully styled the proxy mf2 pages! very inspiring.

      …not quite enough to actually do it myself for bridgy, though. :P

      Sat, Mar 25, 2017 4:38pm -07:00
    • Ryan Barrett snarfed.org

      yay new backfeed implementation!

      design decisions all sound good. looking forward to hearing how they turn out practice.

      btw bridgy actually only resets a user’s polling tier when a webmention is sent successfully. may not matter as much here, depending on adoption.

      Sat, Mar 25, 2017 4:24pm -07:00

    Other Mentions

    • Aaron Parecki aaronparecki.com
      My 2017 Year in Review
      Thu, Jan 4, 2018 2:40pm -08:00
    • 100 Days of IndieWeb aaronparecki.com/tag/100daysofindieweb
      Day 95: Backfeeding Comments and Likes from Swarm #100DaysOfIndieWeb: aaronparecki.com/2017/03/25/5/d…
      Sat, Mar 25, 2017 5:45pm +00:00 (via brid-gy.appspot.com)
Posted in /articles using quill.p3k.io

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv