43°F

Aaron Parecki

  • Articles
  • Notes
  • Projects
  • Day 20: Instagram Support for XRay #100DaysOfIndieWeb

    Mon, Jan 9, 2017 9:25am -08:00

    XRay is my service that parses web pages and extracts information from them. Right now I mostly use it to parse comments, but now that I've been adding support for reposts, it's used there as well.

    Today I added support for XRay to extract data from Instagram URLs!

    This means anything that uses XRay will now return structured data when given an Instagram URL, just like how it parses h-entry and other Microformats. 

    Unfortunately, Instagram does not provide timezone data for the published date, only a Unix timestamp. So if the photo is tagged at a location, then XRay will look up the appropriate timezone for that location and adjust the timezone of the published date accordingly!

    Here's what the parsed JSON looks like for this photo. Note that the timezone is set to East Coast because this photo was taken at MIT.

    {
    "data":{
    "type":"entry",
    "url":"https://www.instagram.com/p/BM4rGs-lApG/",
    "author":{
    "type":"card",
    "name":"Aaron Parecki",
    "url":"http://aaronparecki.com/",
    "photo":"https://scontent.cdninstagram.com/t51.2885-19/s320x320/14240576_268350536897085_1129715662_a.jpg"
    },
    "content":{
    "text":"Here again"
    },
    "photo":[
    "https://scontent.cdninstagram.com/t51.2885-15/e35/14269001_1162908790471145_6084871298582839296_n.jpg?ig_cache_key=MTM4NTA0NjQ2MjAyNzc5NTAxNA%3D%3D.2"
    ],
    "location":[
    "https://www.instagram.com/explore/locations/206258876/"
    ],
    "published":"2016-11-16T16:07:06-05:00"
    },
    "refs":{
    "https://www.instagram.com/explore/locations/206258876/":{
    "type":"card",
    "name":"Massachusetts Institute of Technology (MIT)",
    "url":"https://www.instagram.com/explore/locations/206258876/",
    "latitude":42.360011410484,
    "longitude":-71.091869836761
    }
    }
    }

    In addition to my website using this for reposts and comments, when I paste that URL into IRC, Loqi uses XRay to expand it and provide a little text preview.


    Portland, Oregon
    #100daysofindieweb #100daysofcode #indieweb #xray #instagram
    Mon, Jan 9, 2017 9:25am -08:00
    1 like 1 reply 4 mentions
    • Sebastiaan Andeweg
    • Ryan Barrett snarfed.org

      oh man, awesome!

      comparing to https://granary-demo.appspot.com/instagram/-/@self/@app/BM4rGs-lApG?format=json-mf2, looks like they match up pretty well.

      one interesting difference: did you do an extra profile URL fetch to get http://aaronparecki.com/? it’s not in https://www.instagram.com/p/BM4rGs-lApG/ anywhere.

      otherwise, next step, comments and likes? :P

      Mon, Jan 9, 2017 10:34am -08:00

    Other Mentions

    • 100 Days of IndieWeb aaronparecki.com/tag/100daysofindieweb
      Day 20: Instagram Support for XRay #100DaysOfIndieWeb: aaronparecki.com/2017/01/09/4/d…
      Mon, Jan 9, 2017 5:25pm +00:00 (via brid-gy.appspot.com)
    • Aaron Parecki aaronparecki.com
      Day 21: Twitter Support for XRay #100DaysOfIndieWeb
      Tue, Jan 10, 2017 3:36pm -08:00
    • Aaron Parecki aaronparecki.com
      Week in Review #100DaysOfIndieWeb
      Sat, Jan 14, 2017 10:48am -08:00
    • Aaron Parecki aaronparecki.com
      My 2017 Year in Review
      Thu, Jan 4, 2018 2:40pm -08:00
Posted in /articles using quill.p3k.io

Hi, I'm Aaron Parecki, co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and am the editor of several W3C specfications. I record videos for local conferences and help run a podcast studio in Portland.

I wrote 100 songs in 100 days! 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. Read more.

Follow
  • Okta Developer Advocate
  • IndieWebCamp Founder
  • W3C Editor
  • Stream PDX Co-Founder
  • backpedal.tv

  • W7APK
  • ⭐️ Life Stack
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Sleep
  • Travel
  • Contact
© 1999-2019 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