Skip to content

changkun/urlstat

Repository files navigation

urlstat

urlstat provides basic facility for pv/uv statistic cross websites. It is designed for blog.changkun.de, golang.design/research and etc.

Usage

Plain Mode

Add the following script to a page:

<script async src="//changkun.de/urlstat/client.js"></script>

The script will look for elements with ID urlstat-site-pv, urlstat-site-uv, urlstat-page-pv, and urlstat-page-uv and manipulate the information if the retrieve succeed. For instance:

<span id="urlstat-site-pv"><!-- info will be inserted --></span>
<span id="urlstat-site-uv"><!-- info will be inserted --></span>
<span id="urlstat-page-pv"><!-- info will be inserted --></span>
<span id="urlstat-page-uv"><!-- info will be inserted --></span>

An example, see https://golang.design/research/zero-alloc-call-sched/

image

GitHub Mode

Use query parameter: mode=github and repo=username/reponame. For instance:

![](https://changkun.de/urlstat?mode=github&repo=changkun/urlstat)

License

MIT © 2021 Changkun Ou