Code Monkey home page Code Monkey logo

hit-counter's Introduction

HITS

Hits A simple way to see how many people have visited your website or GitHub repo.

license Go Report Card

Overview

HITS provides the SVG badge presented title and daily/total page count.

If you embed the badge on either website or GitHub or Notion, every page request (page hit) will be counted.

The badge includes per day (from GMT) and the total (all) page count.

HITS also shows the GitHub projects with the highest visitors. (TOP 10)

HITS shows real-time page hits (using Websocket) of every project or site that is using this service.

HITS was made by [email protected] using Golang, WebAssembly (Wasm), HTML, currently serving from Google Cloud platform.

How To Use

How To Generate The Badge

You generate the badge through HITS.

Hits

Features

  • Displays daily and total page views on your page.
  • Support badge with customize style.
  • Support badge free icon (https://simpleicons.org).
  • Show a graph of your site about daily count of histories in recently 6 month.
  • Show ranks about github projects.
  • Show real-time stream.

ETC

HITS counts every page hit without storing sensitive information (IP, headers, etc.).
To protect from abuse by massive requests, parts of request information are converted to hashing data in local-cache, and it deletes after the elapsed time.

Also, HITS does not use GitHub Traffic or Google Analytics data, it simply counts every page hit of your site or repo.

LICENSE

This project is licensed under GPL V3.0.

hit-counter's People

Contributors

gjbae1212 avatar jdevfullstack avatar jungdu avatar ryanfortner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hit-counter's Issues

Todo List

Todo List

Style changes

  • Change Main logo
  • Change styles in SHOW STREAM section
  • Change graph size to responsive
  • Make Top 10 site linkable.
  • Make Icon Selector.
  • Footer design

To add

  • Simple usage
  • Feed back form

not working in Notion

It used to work perfectly in my (wife's) notion page but now it is not working. The hit count not changing any more and the customized logo and color is gone. I checked on other people's Notion page and see the same.
Would you please check on this?

Thanks!

GitHub Pages

Does this Counter work on GitHub Pages? I want to host a static newsletter website on Pages and want a counter to count the number of views. Will this be able to serve the purpose?

How to confirm graph on local

I'd like to confirm the graph for changing styles on the graph.

CORS related error occurs when attempting to show the graph.

Access to fetch at 'https://hits.seeyoufarm.com/api/count/graph/dailyhits.svg?url=https://github.com/gjbae1212/hit-counter' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
WebSocket connection to 'wss://hits.seeyoufarm.com/ws' failed: Error during WebSocket handshake: Unexpected response code: 403

Issue with cookies

Hey,

Google Chrome is blocking the cookies from the counter.

This is what it says in the console:
A cookie associated with a cross-site resource at http://hits.seeyoufarm.com/ was set without the SameSite attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with SameSite=None and Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

Solved: How to Query Raw Counts from Command Line

Here's how you can retrieve the raw count data from the command line using PowerShell:

$response = Invoke-WebRequest -Uri "https://hits.seeyoufarm.com/api/count/keep/badge.svg?url=https://your-website.com"
$content = $response.Content
$counts = ($content | Select-String -Pattern "[0-9]+ / [0-9]+" -All).Matches[0].Value
Write-Host "Counts: $counts"

image

The history graph data can be queried in a similar fashion using this endpoint:
https://hits.seeyoufarm.com/api/count/graph/dailyhits.svg?url=https://your-website.com
You'll need to do a lot of RegEx parsing to pull the historical data out of the SVG code, but the general principle is the same as my prior example above.

export site stat data

I have been using on more hit counter which recently was closed down. All of my stats are wiped off. So just to be on safe side, is there a way to keep exporting data when needed ?

Sentence Structure

Hi, I wanted to let you know in the Features sections, the words had some grammatical errors. Don't worry I fixed them. Below are the corrected sentences.

Features

  1. Displays daily and total page views on your page.
  2. Support badge with customized style.
  3. Support badge free icon
  4. Show a graph of your site about the daily count of histories in recently 6 months.
  5. The show ranks GitHub projects.
  6. Shows real-time stream.

Setting start value of hit counter

As the title suggests I was wondering if a setting could be implemented that allows the user to start the value of the hit counter off at something over than zero. I've been using github reports to get analytics for the past few months and have tens of thousands of hits on my site. I want to represent that with a button like this but it only counts from the time the button was created - therefore starting at zero.

Would it be possible to set the start value of the hit counter

How to get data from command line

Is there away to get the raw count data (not svg badge) and history graph directly from the command line using curl. Or by using flags non-interactively as in website

readme.md fork issue

I know this issue is not directly related to the counter but neverless it draws the counter as unreliable because summons additional hits per each forked readme.md.

The root of the issue is that when the repository with the readme and counter inside is forked then the hardcoded url with the original user is left as is. So the forked page will increment the same counter.

The issue has already mentioned many years ago and there is still not fixed:
https://stackoverflow.com/questions/32408146/does-github-support-username-variable-in-readme-md

The alternative implementation is to accumulate a repo github view hits using github actions and reference it by json data badge:
https://github.com/andry81/github-accum-stats

As an additional plus there would not be counted any click from the repo owner and the counter will be stored in a repository.

The minus is that the github does not increment a profile repo page views counter on a profile page view, where: github.com/user/user - profile repo page, github.com/user - profile page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.