https://github.com/devxprite/visit-counter
Easy way to know how many visitors are viewing your Github, Website
https://github.com/devxprite/visit-counter
counter hacktoberfest hit-counter nodejs sc scss view-counter visit-count visit-counter
Last synced: 8 months ago
JSON representation
Easy way to know how many visitors are viewing your Github, Website
- Host: GitHub
- URL: https://github.com/devxprite/visit-counter
- Owner: devxprite
- License: gpl-3.0
- Created: 2022-09-05T15:21:45.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-18T15:27:48.000Z (over 2 years ago)
- Last Synced: 2025-02-02T08:31:50.388Z (8 months ago)
- Topics: counter, hacktoberfest, hit-counter, nodejs, sc, scss, view-counter, visit-count, visit-counter
- Language: JavaScript
- Homepage: https://visit-counter.vercel.app
- Size: 381 KB
- Stars: 18
- Watchers: 1
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Reference for Image
| query | Usage | Default | Example |
| ----- | ------------------------------------------- | ----------- | ---------------------------------------------------------------------------- |
| page | It can be your username or your website url | | https://visit-counter.vercel.app/counter.png?page=example.com |
| s | Font size of counter | 40 | https://visit-counter.vercel.app/counter.png?page=example.com&s=60 |
| c | Color of counter | #00ff00 | https://visit-counter.vercel.app/counter.png?page=example.com&c=00ffff |
| bg | Background Color of counter | transparent | https://visit-counter.vercel.app/counter.png?page=example.com&bg=000000 |
| ff | Font Family | Digital | https://visit-counter.vercel.app/counter.png?page=example.com&ff=electrolize |
| no | No of digits in Counter | 2 | https://visit-counter.vercel.app/counter.png?page=example.com&no=6 |
| tb | Text to put before count | "" | https://visit-counter.vercel.app/counter.png?page=example.com&tb="Count: " |
| ta | Text to put after count | "" | https://visit-counter.vercel.app/counter.png?page=example.com&ta=" visitors" |## Getting the Raw Counts
If you don't want the PNG file but still want the count to use in something else, you can do a GET request to `/counter`### Using fetch in javascript
```javascript
fetch("https://visit-counter.vercel.app/counter?page=example.com")
.then(response => response.text())
.then(count => console.log('counts: ',count));
```### Using Requests in Python
```python
import requestsurl = "https://visit-counter.vercel.app/counter?page=example.com"
response = requests.request("GET", url)print("counts:", response.text)
```### Using cURL in PHP
```php
'https://visit-counter.vercel.app/counter?page=example.com',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));$response = curl_exec($curl);
curl_close($curl);echo "counts: $response";
```## Installation
1. Get your firebase database URL at [here](https://console.firebase.google.com)
2. Clone the repo
```bash
git clone https://github.com/devXprite/visit-counter
```
3. Install NPM packages
```bash
cd visit-counter
npm install
```
4. Enter your Database URL in `.env`
```bash
FIREBASE_DATABASE='YOUR DATABASE URL'
```
5. Start Server
```bash
npm start
```## Deploy
Click this button to configure your Project and deploy it to Vercel.[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FdevXprite%2Fvisit-counter&env=FIREBASE_DATABASE)