Shields: Badge request: Facebook & Instagram

Created on 26 Sep 2018  ยท  16Comments  ยท  Source: badges/shields

It would be great to have a badge for Facebook and Instagram. Ideally it would show number of likes for a page or followers for an account. Are there already any plans to implement these? On my website I already have GitHub and Twitter, so I was just curious about the other candidates.

service-badge

Most helpful comment

Instagram returns JSON if you add ?__a=1 to the end of a user's profile URL. Example: https://www.instagram.com/instagram/?__a=1

All 16 comments

No plans. If you can suggest API endpoints that might be useful for this that would help if another contributor interested in this.

Thank you for your suggestion! We've got a nice tutorial if you would like to have a go at implementing these new badges and make a contribution to Shields! ๐Ÿ˜‰

Instagram returns JSON if you add ?__a=1 to the end of a user's profile URL. Example: https://www.instagram.com/instagram/?__a=1

Good to know. Feel free to give it a go @pedrofracassi ! It would be nice badge to add to Shields! I'm also happy to give it a go if you're busy with other things. :wink:

I'm giving Shields a go with the Lerna badge right now. You can do this one, @PyvesB :)

I tried creating an Instagram account to try some things out, this has proven surprisingly challenging (see my Tweet for more info). ๐Ÿ˜•

Our Twitter badge is linked to a nice "Follow" intent URL, for example: https://twitter.com/intent/follow?screen_name=shields_io

Is something similar possible with Instagram? What does the link on the "Follow" button look like for logged in users?

I've no idea either (never used it) ๐Ÿคทโ€โ™‚

Hopefully some more instagram-fluent folks can chime in!

I fiddled around with the Instagram web client, and it sends a POST request to https://www.instagram.com/web/friendships/:id/follow/ when you click the button. I don't think there's an intent URL for following like Twitter.

I fiddled around with the Instagram web client, and it sends a POST request to https://www.instagram.com/web/friendships/:id/follow/ when you click the button. I don't think there's an intent URL for following like Twitter.

Thanks for the information. I'll keep things simple and just link to the profile page.

Bad news, I noticed that the badge on the review app broke just before I wanted to merge it. This is probably due to API rate limiting.

I had initially read on various websites that the request rate was set to 5000/hour, which seemed like more than enough for an initial implementation, especially given that the rate is multiplied by our number of live servers.

However, after some more digging, this number was apparently reduced to 200 last year: https://stackoverflow.com/questions/49583489/did-instagram-change-api-rate-limits-on-mar-30-2018

This is way too low to even consider pushing my current implementation to production. Instagram's documentation has a lot of broken links (e.g. https://www.instagram.com/developer/limits/), but I think the most up-to-date version is the following:

Requests made by your app to the Instagram Graph API are counted against the appโ€™s call count. An appโ€™s call count is the number of calls during a rolling 24 hour window and is calculated as follows:
Calls within 24 hours = 4800 * Number of Impressions

The Number of Impressions is the number of times any content from your Instagram account entered a person's screen.

If I'm understanding the above correctly, we can only get a high enough rate if the account linked to the API token is popular enough.

I can see three ways forward here:

  • either someone with a popular account (preferably part of the maintainer team) provides us with a token.
  • either we create an official Shields.io account and occasionally post pictures of our badges/Readmes on it. If users want the Instagram badges to work, they will have to visit our page, which is actually a somewhat amusing concept (though extra work for whoever maintains the account)!
  • either we drop the whole idea and close this issue (I suspect Facebook badges will have the same problem).

Obviously we could also do website scrapping, but we've decided against that for many other badges due to maintainability and performance concerns.

I really appreciate all the work you've done on this @PyvesB!

The idea of a Shields account on Instagram is amusing ๐Ÿ˜. Though frankly unless we feel we can curate an account that is gonna be fun to post to โ€“ and fun for people to follow โ€“ I don't think we should bother.

By the way, is it the number of impressions for the user whose API key is being used, or the number of impressions on the account being queried?

I am not completely convinced Instagram crosses the bar of "widely used by developers," at least not in a way that is relevant to the way they promote themselves as software developers. @rwieruch I found your Instagram, but I couldn't find it linked from your site. (Oh! There it is. I found it at the bottom.)

I wonder if developers who are dedicated Instagrammers and FB users could be served by the Endpoint badge or similar. You could use a RunKit endpoint that's scoped to yourself, either scraping, or using the GraphQL call @PyvesB found.

If the endpoint response include cacheSeconds: 7200 (or even cacheSeconds: 86400), hopefully our servers won't hit it very often.

:camera: Remember to like, comment and subscribe to increase our rate limit :wink:

If we're really keen to add this, another solution to consider would be to crowdsourcing a token poll like we use for GitHub (assuming it is possible to have a read-only key). Lots of keys with a small limit is effectively the same as one key with a high limit. I'm not that convinced it would be something that loads of users care about in the same way though.

What are you using, @PyvesB? The official, documented API or that ?__a=1 link I sent here?

By the way, is it the number of impressions for the user whose API key is being used, or the number of impressions on the account being queried?

The documentation is not very clear, but I think the user whose API key is being used. I was querying the official Instagram account and that was apparently getting rate limited. Basically if you're a popular Instagrammer, they let you hit their API more.

I am not completely convinced Instagram crosses the bar of "widely used by developers," at least not in a way that is relevant to the way they promote themselves as software developers. @rwieruch I found your Instagram, but I couldn't find it linked from your site. (Oh! There it is. I found it at the bottom.)

True, but a lot of our "social" badges are kind of borderline anyway: Twitter, Reddit, Mastodon, etc. are not primarily focused on developers. Same goes for Instagram, but some developers use it to share photos of conferences or events they attend, others use it for meetup community pages. Similarly, there are a lot of dev-focused pages on Facebook. Instagram seemed like a good candidate for widening the scope of Shields.io a bit, but without deviating too much either. ๐Ÿ˜‰

๐Ÿ“ท Remember to like, comment and subscribe to increase our rate limit ๐Ÿ˜‰

That would indeed be a cool slogan. But I agree with @paulmelnikow's points as well. It's already somewhat challenging to keep our Twitter account going, we may struggle to additionally maintain a fun Instagram account.

If we're really keen to add this, another solution to consider would be to crowdsourcing a token poll like we use for GitHub (assuming it is possible to have a read-only key). Lots of keys with a small limit is effectively the same as one key with a high limit. I'm not that convinced it would be something that loads of users care about in the same way though.

That could work, however I'm somewhat reluctant to implementing a more complex solution for an initial implementation of a new badge. If only a few users end up using the badge, it won't be worth the effort. Maybe we can open a Twitter poll to see if users would actually be interested in this? This GitHub issue is so many pages behind that it's hard to find and hasn't received much attention.

What are you using, @PyvesB? The official, documented API or that ?__a=1 link I sent here?

The link you sent here. You can check out the opened pull request. ๐Ÿ˜‰

That would indeed be a cool slogan
we may struggle to additionally maintain a fun Instagram account

Just to be clear, I'm not actually advocating we maintain a shields instagram account. I just found it an amusing concept :)

That could work, however I'm somewhat reluctant to implementing a more complex solution for an initial implementation of a new badge. If only a few users end up using the badge, it won't be worth the effort. Maybe we can open a Twitter poll to see if users would actually be interested in this? This GitHub issue is so many pages behind that it's hard to find and hasn't received much attention.

Yep - agreed. As a point of comparison, the GitHub actions issue ( #2574 ) which is also buried on page 6 of the tracker at this point in time has 137 +1s. This issue has 1. I think its safe to assume demand for this is quite limited at this point.

I think the pragmatic thing to do is to simply drop the idea of adding Instagram or Facebook badges for now. The additional effort required, either by continually maintaining an Instagram account or implementing a much more complex token pool solution, outweighs the value brought to Shields, given the small number of users who have actually shown interest in these badges. I've closed the linked PR and this issue accordingly.

One easy-ish solution remains: if one of our regular contributors/maintainers is willing to provide a token from their own popular Instagram account, I'm happy to reconsider and rework my PR to support a single token approach. Let me know if this is the case. ๐Ÿ˜‰

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulmelnikow picture paulmelnikow  ยท  3Comments

techtonik picture techtonik  ยท  3Comments

Fazendaaa picture Fazendaaa  ยท  3Comments

Turnerj picture Turnerj  ยท  3Comments

niccokunzmann picture niccokunzmann  ยท  3Comments