A visitor count service for your Blog, Portfolio website or Github repo or issue
Find a file
Raman 921f7acc8c
Merge pull request #2 from ramank775/feat/additional-new-feature
feat: added functionality

- Added option to get current count without incrementing
- Add option to count unique visit within a particular timeframe
- Updated Readme and index.html
2023-12-03 17:58:32 +05:30
.github feat: added github action for image push 2023-11-25 14:14:07 +05:30
templates feat: added functionality 2023-12-03 17:56:37 +05:30
.dockerignore Containerized application 2022-04-14 17:07:33 +05:30
.env add dotenv support to store md5 key config 2020-04-10 23:12:22 +08:00
.gitignore Update gitignore 2020-04-10 19:43:30 +08:00
docker-compose.yml feat: added functionality 2023-12-03 17:56:37 +05:30
Dockerfile Containerized application 2022-04-14 17:07:33 +05:30
LICENSE Initial commit 2020-03-27 15:09:21 +08:00
main.py feat: added functionality 2023-12-03 17:56:37 +05:30
README.md feat: added functionality 2023-12-03 17:56:37 +05:30
requirements.txt feat: switch to redis 2023-11-25 14:06:13 +05:30
runtime.txt First commit with badge gen ok and non finished index page 2020-04-10 19:43:17 +08:00
start.sh add dotenv support to store md5 key config 2020-04-10 23:12:22 +08:00

Visitor Badge

Count visitors for your GitHub, Blog or Portfolio Site in just one line markdown code or one api call

visitor badge

How to use?

If you know how to add picture in markdown or image in html, then you are good to go.

Markdown

![visitors](https://visitor-badge.example.net/badge?page_id={page.id}&left_color=red&right_color=green)

HTML

<img src="https://visitor-badge.example.net/badge?page_id={page.id}&left_color=red&right_color=green" />

API

curl -X GET "http://visitor-badge.example.net/count?page_id={page.id}"  

// output: {"value": 100}

Options

Params Required Default Description
padge_id Required null Unique string to best represent your page
namespace Optional default Unique key to group all your pages and avoid conflict with others
read Optional false Only return existing count, don't increment
unique (experimental) Optional false Only count unique request within a given window as set by timeframe param. Note: this is experimental flag may not work as desired
timeframe Optional 600 Time window for which a request is considered as duplicate if unique param is set
*left_color Optional #595959 Left side color of the badge
*left_text Optional visitor Left side text of the badge
*right_color Optional #1283c3 Right side color of the badge

Note: * options only applied for path /badge

Public Servers

  • URL: https://visitor-badge.one9x.com

    Free: Yes

    Please be aware that this server is hosted on a homelab environment, which may result in occasional downtime or data loss. To minimize the risk of data loss, nightly data snapshots are taken at 12:00 AM IST.

What's next?

What new features will be available in the next release?

  • Data backup

    Regularly backup the latest data into a safe place weekly and make it recoverable

  • Stable unique count implementation

    Implement a stable solution to track unique visitor

  • Namespace Management

    Ability to set configuration at namespace level

Have something in mind? Just tell me...

Fork From

jwenjianhttps://github.com/jwenjian/visitor-badge