Facebook, who owns Instagram, has really tightened up their credentials for who can use their API since switching from their legacy API to their Graph API in 2020. In order to grab Instagram data based on a hashtag, I had to have a working prototype of the app, request access to 4 different permissions, write a summary of how I will use each of the permissions and upload a screencast displaying how each of the permissions would be used. After doing ALL of that, I had a 5-7 day wait to get a response. So I waited …. And….
Source: https://media.giphy.com/media/iqW0R1UyYc9CLDGQmR/giphy.gif
For my non-sports-loving friends, that is a monster of a man Zion Williamson (aka Facebook) rejecting the crap out of some scrub (aka me 🙁).
Well ok then, let's try again. Facebook gave me some very broad feedback that I tried to follow. I read a few blog posts, watched a few videos, and even reached out to Nebo’s Facebook marketing rep for some pointers. By the end of my day, I had developed an amazing pitch as to why I need these permissions. I sent it in…. waited 5-7 days…. And….
Source: https://media.giphy.com/media/iqW0R1UyYc9CLDGQmR/giphy.gif
It was time to come up with another plan, and that’s when I learned that Instagram allows you to make a GET request to their explore page, which returns a big, gross JSON response of post data. With enough patience and determination, I was able to parse through this JSON in order to grab the caption, post date, and image link. Luckily, Twitter was much easier to deal with thanks to the Twitter gem, so pulling out the Tweet and user information was easy.
A downside of pulling Instagram posts from the explore page? I couldn't ensure the content is appropriate or even relevant. The Twitter Gem allows users to filter by certain accounts, which helps filter out spam, but we want our app to be open to all event attendees. As anyone who is familiar with a lot of the content on Instagram and Twitter knows, this has the potential to be a major issue when displaying posts to a packed room full of people.