Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdheshnayak/hits
A Simple to implement hits counter in your static website
https://github.com/abdheshnayak/hits
Last synced: 14 days ago
JSON representation
A Simple to implement hits counter in your static website
- Host: GitHub
- URL: https://github.com/abdheshnayak/hits
- Owner: abdheshnayak
- License: apache-2.0
- Created: 2020-05-07T00:54:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T16:28:58.000Z (10 months ago)
- Last Synced: 2024-04-06T17:30:21.782Z (10 months ago)
- Homepage:
- Size: 28.3 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hits Counter
A simple way to implement views/visits counter on your website.
get api key here [https://rapidapi.com/abdheshnayak/api/counter10](https://rapidapi.com/abdheshnayak/api/counter10)
**Example**
![viewsCount](https://img.shields.io/endpoint?url=https://counter10.p.rapidapi.com/?rapidapi-key=44fcc7f8f7mshacfcb91fc4190bfp189dddjsnaa696e83052d%26%26ID=testpage)
## Implementation
#### Decide a page id which will be unique.
Your **page id** must not contain any **space** and please use a **unique** keyword.
And your every individual **page** needs a new **unique id**.
So, I suggest to use your id like this:
if your domain is **eample.com** and page is home```
example_com_home
or
eample-com-home
or
eeamplecomhome
```> or you can use a nike name like,
```
ak-example_com_home
```# Implementation
### In HTML
You just need to implement an IMG tag in your HTML source code. and put the value of src attribute as given below
```
```where you have to just change your ID
like```
ID=eample-com
```so the link will be
```
https://img.shields.io/endpoint?url=https://counter10.p.rapidapi.com/?rapidapi-key=api-key%26%26ID=eample-com
```### Example
```
Views Counter Test Page
Views Counter Test Page
```
### In README.md
```
![viewsCount](https://img.shields.io/endpoint?url=https://counter10.p.rapidapi.com/?rapidapi-key=44fcc7f8f7mshacfcb91fc4190bfp189dddjsnaa696e83052d%26%26ID=testpage)
```### Showing without updating Count
You can use IDV for see only views without updating views count.
**example:**```
https://img.shields.io/endpoint?url=https://counter10.p.rapidapi.com/?rapidapi-key=44fcc7f8f7mshacfcb91fc4190bfp189dddjsnaa696e83052d%26%26IDV=testpage
```## Use Different Color
You can select the badge of your with different color, also for doing that you have to add do only one attribute i.e. color in the link.
>
Select a color from above and then use it like this.
```
above_link%26%26COLOR=colorname
```like,
```
https://img.shields.io/endpoint?url=https://counter10.p.rapidapi.com/?rapidapi-key=api-key%26%26IDV=testpage%26%26COLOR=blueviolet
```**Result**
![viewsCount](https://img.shields.io/endpoint?url=https://counter10.p.rapidapi.com/?rapidapi-key=44fcc7f8f7mshacfcb91fc4190bfp189dddjsnaa696e83052d%26%26IDV=testpage%26%26COLOR=blueviolet)
## Lable Color
You can also change lable color by adding %26%26CLABEL=colorname
```
above_link%26%26CLABEL=colorname
```like,
```
https://img.shields.io/endpoint?url=https://counter10.p.rapidapi.com/?rapidapi-key=api-key%26%26IDV=testpage%26%26COLOR=blueviolet%26%26CLABEL=green
```**Result**
![viewsCount](https://img.shields.io/endpoint?url=https://counter10.p.rapidapi.com/?rapidapi-key=44fcc7f8f7mshacfcb91fc4190bfp189dddjsnaa696e83052d%26%26IDV=testpage%26%26COLOR=blueviolet%26%26CLABEL=green)
## Built With
- **NodeJs**
- **MongoDb**## LICENSE
This project is licensed under the Apache License 2.0 - see the [LICENSE](https://github.com/abdheshnayak/static-website-views-counter/blob/master/LICENSE) file for details
## Authors
> **Abdhesh Nayak**
[![Icon](https://img.shields.io/badge/Github-lightgrey)](https://github.com/abdheshnayak) [![Icon](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/abdhesh-nayak/)
**See also the list of [Contributors](https://github.com/abdheshnayak/static-website-views-counter/contributors) who participated in this project.**