Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badge request: Facebook & Instagram #2120

Closed
rwieruch opened this issue Sep 26, 2018 · 16 comments
Closed

Badge request: Facebook & Instagram #2120

rwieruch opened this issue Sep 26, 2018 · 16 comments
Assignees
Labels
service-badge New or updated service badge

Comments

@rwieruch
Copy link

rwieruch commented Sep 26, 2018

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.

@chris48s
Copy link
Member

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

@chris48s chris48s added the service-badge New or updated service badge label Sep 27, 2018
@PyvesB
Copy link
Member

PyvesB commented Oct 5, 2018

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! 😉

@PyvesB PyvesB added good first issue New contributors, join in! hacktoberfest Same as "good first issue" labels Oct 6, 2018
@platan platan removed hacktoberfest Same as "good first issue" labels Nov 1, 2018
@paulmelnikow paulmelnikow changed the title Facebook & Instagram Shield Badge request: Facebook & Instagram Jan 25, 2019
@pedrofracassi
Copy link
Contributor

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

@PyvesB
Copy link
Member

PyvesB commented Oct 28, 2019

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. 😉

@pedrofracassi
Copy link
Contributor

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

@PyvesB PyvesB self-assigned this Oct 28, 2019
@PyvesB
Copy link
Member

PyvesB commented Nov 9, 2019

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?

@calebcartwright
Copy link
Member

I've no idea either (never used it) 🤷‍♂

Hopefully some more instagram-fluent folks can chime in!

@pedrofracassi
Copy link
Contributor

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.

@PyvesB
Copy link
Member

PyvesB commented Nov 16, 2019

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.

@PyvesB
Copy link
Member

PyvesB commented Nov 16, 2019

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.

@paulmelnikow
Copy link
Member

paulmelnikow commented Nov 16, 2019

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.

@chris48s
Copy link
Member

📷 Remember to like, comment and subscribe to increase our rate limit 😉

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.

@pedrofracassi
Copy link
Contributor

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

@PyvesB
Copy link
Member

PyvesB commented Nov 17, 2019

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. 😉

@chris48s
Copy link
Member

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.

@PyvesB PyvesB removed the good first issue New contributors, join in! label Nov 23, 2019
@PyvesB
Copy link
Member

PyvesB commented Nov 23, 2019

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. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests

7 participants