Readme downloads badge for plugins

So, currently we store plugin downloads in this file. But I wanted to show the downloads of my plugin as a readme badge. I created a badge and you can see it in my plugins readme.

I did this by creating a serverless function deployed on vercel that calculates the downloads for my plugin and then I used dynamic shield generator by shields.io to create the badge.

You can see the source code of the serverless function here -> GitHub - nishantwrp/joplin-plugin-downloads: A serverless function that calculates the downloads of my joplin plugin - Templates.. It's deployed on joplin-plugin-templates.vercel.app/api. Currently, it's configured to calculate downloads for my plugin only. But I can generalize it for every plugin.

So, wanted to know if other plugin developers would be interested in adding readme download badges for their plugins.

3 Likes

This is great. Nice solution. I wanted to add the number of downloads to the Plugins List, but the table is already too narrow. I've been using the following to get the stats for all plugins:

curl -s https://raw.githubusercontent.com/joplin/plugins/master/stats.json |jq '[. |to_entries[] | {"key": .key, "value": [.value[].downloadCount] |add}] | from_entries' | column -t |tr -d ',' |grep -v '{' |grep -v '}' |sort -k2 -rn |tr -d '"' |tr -d ':'

Although I would still have to map it to the plugin names.

1 Like

Hi, I've updated the api to be generalised.

Usage

  • GET https://joplin-plugin-downloads.vercel.app/api - Gets the download and release details for all joplin plugins.
  • GET https://joplin-plugin-downloads.vercel.app/api?plugin=<plugin_id> - Gets the download and release details for a specific plugin.
2 Likes