template icon indicating copy to clipboard operation
template copied to clipboard

Add Installations Badge for number of installations of App

Open abhijeetps opened this issue 7 years ago • 8 comments

I think it would be really cool, if we can add an installation badge in README.md of your application repository. It could look something like this: Installs Badge

How to add this badge in your repository? I am using Dynamic Badge feature provided by Sheilds.io. Using this, one can add dynamic badges to show number of installations of the application.

Here's a template to know installations of your app: https\://img.shields.io/badge/dynamic/json.svg?label={LABEL}&url={DEPLOYMENT-URL}/stats&query={QUERY}&colorB={HEXCODE}&style={SOME-STYLE}

Here's how to configure the badge using above template ☝️

Placeholder Replace with
{LABEL} Install (Or Installations, or whatever name you would like to add)
{DEPLOYMENT-URL} URL where you have deployed your app. (Note: This will only work if you have enabled stats for your app
{QUERY} Uses jsonpath, for probot app, this should be $.installations
{HEX-CODE} Hex code of the color you want (without # symbol)
{SOME-STYLE} One of the Styles provided by Shield.io

Thus, for example, for the Weekly Digest app, the number of installation badge could look something like this: https://img.shields.io/badge/dynamic/json.svg?label=installs&url=https://weekly-digest.glitch.me/probot/stats&query=$.installations&colorB=01B1D7&style=for-the-badge

As @hiimbex suggested that this could be added to Probot template, please let me know where I can add this so that I can open a PR for the same. 😄

abhijeetps avatar Jul 09 '18 02:07 abhijeetps

this is really cool :+1: :100:

itaditya avatar Jul 09 '18 14:07 itaditya

I think this is a really cool idea.

However…It would require knowing the deployment host at the time the app is generated, and I'm guessing most apps wont have that information. So putting it in the template would lead to a lot of broken badges for new Probot apps.

Is there a way we can submit a PR to add the badge as part of the process for listing your app on probot.github.io?

bkeepers avatar Jul 09 '18 14:07 bkeepers

@bkeepers agree with you. One thing though, there are many apps which are not submitted for listing. So I was thinking if we could have a static probot badge which is included in the template.

itaditya avatar Jul 09 '18 16:07 itaditya

we do have a really cool logo, so building a custom badge for probot won't be that difficult

itaditya avatar Jul 09 '18 16:07 itaditya

Good point @bkeepers, I was thinking about that too, but we do have some fields we leave like this currently.

So it could look like:

https://img.shields.io/badge/dynamic/json.svg?label=Installations&url={DEPLOYMENT-URL}/stats&query=$.installations&colorB=2196F3&style=for-the-badge

I just filled in all the factors we can decide: like styling, what it says should be consistent across repos. So that really only leaves the deployment url to add in, which I don't think is a terrible state to leave the readme in, but it might also be nice to require a PR to add the badge for the site.

Maybe we could automate the pr to add the badge when someone opens a PR to the site? That could be tricky since people put their badges at different spots in the readme.

In the meantime, we can certainly add it to the Pull request template checklist!

I'll be happy to open a PR over there is we're all satisfied with the colors styling and look of the badge right now. It would be ideal to keep this badge consistent!

I kind of like this style: Github All Releases and I think downloads is in the same vein of installs?

hiimbex avatar Jul 09 '18 23:07 hiimbex

but we do have some fields we leave like this currently

I don't think there are currently any fields that don't get filled out when create-probot-app is run, are there?

bkeepers avatar Jul 10 '18 14:07 bkeepers

background-check is using this now https://github.com/probot/background-check

GitHub
background-check - A GitHub App built with probot that peforms a "background check" to identify users who have been toxic in the past, and shares their toxic activity in the maintainer’s ...

itaditya avatar Jul 10 '18 18:07 itaditya

I don't think there are currently any fields that don't get filled out when create-probot-app is run, are there?

Ah you're right. I was just thinking about if you leave fields empty when filling out on the command line. But still good point

hiimbex avatar Jul 10 '18 18:07 hiimbex