pbs-assess / pacea

An R package to house Pacific Region ecosystem data to help facilitate an ecosystem approach to fisheries.
Other
14 stars 0 forks source link

Add a badge to keep track of installations from GitHub (if possible) #40

Closed andrew-edwards closed 8 months ago

andrew-edwards commented 9 months ago

Quick Google Search doesn't find anything. Not sure if it's possible to keep track of downloads of an R package on GitHub (that aren't simply downloads of the zip file, which isn't what users will do), and the package will not be on CRAN.

travistai2 commented 8 months ago

Did some searching and found one link to create a visitors badge. Only daily and total visitors available. I've added a 'Total' visitors badge to our github. https://github.com/estruyf/github-visitors-badge https://visitorbadge.io/

Another website that looks great for other badges is Shields.io https://github.com/badges/shields https://shields.io/

Can't seem to find a badge for unique visitors though, which would be more helpful than visitors. I know we can see the unique visitors through the 'Insights/traffic' tab but I'm not sure how to pull out the unique visitors value to create a badge.

cgrandin commented 8 months ago

To monitor downloads of releases just put this in your README.md:

[![Github All Releases](https://img.shields.io/github/downloads/pbs-assess/pacea/total.svg)]()

But I believe that only increases when people click releases and download. Not sure if that's what you're after. But can test it out at least.

andrew-edwards commented 8 months ago

Thanks Chris. But my guess is that might indeed only track downloads like downloading the .zip file from GitHub, rather than people using remotes::install_github("pbs-assess/pacea") which is what would be ideal. Travis is looking for a unique visitors one, which won't increase as quickly as the current one seems to be.

seananderson commented 8 months ago

I'm pretty sure there is no solution with remotes::install_github() https://github.com/r-lib/devtools/issues/1729

You would need to put it on CRAN.

andrew-edwards commented 8 months ago

Thanks, yes that's what we thought. And don't intend to post on CRAN (mainly because we'll be frequently updating it).

andrew-edwards commented 8 months ago

Thanks. Looks like no unique visitors badge available, so stick with the current one for now. Though it cheats a little as seems to up the count just doing a refresh :o