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.

4 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.
4 Likes

Bumping in case anyone want this, since there are a lot more plugins now.

1 Like

What does the down arrow next to each plugin in the Plugin List signify?

Would be useful to have a column with a link to a discourse discussion thread re: the plugin, if one exists.

Download

That is the "home" button next to it. We don't specify the link, but the plugin devs do. It's in the manifest. Some devs choose to use the gh page, other the forum thread.

1 Like