Generate your own "hits" (How idiots track success) badge to your repositories and track page views.
If an user look at your README or other markdown file, that include the badge, a request to the counter application with the repository key is sent. The application saves the page-view in the related redis database and returns the updated badge.
For the easiest install you need a docker'able hosting plattform or service. Personal i'm using DigitalOcean for this.
Alternately you can only take the application part.
- Install dependencies via Composer for the application
$ cd app
$ composer install --no-dev
- Set a password for redis here
- Update the nginx vhost file (server_name)
- Add certs for your domain here (private.key and ssl-bundle.crt)
- (optional) Update redis.conf (password is set automatically)
After this just run the following commands:
$ docker-compose build
and
$ docker-compose up -d
Look at the top of this document and reload. :-)
If something went wrong you can first set the debug mode for the Silex application.
$app['debug'] = true;
And if you want some more fancy badges update the svg part in the application.
<svg xmlns="http://www.w3.org/2000/svg" width="95" height="20">
...
</svg>
- add a data-container for redis database