Coder Social home page Coder Social logo

antonkomarev / github-profile-views-counter Goto Github PK

View Code? Open in Web Editor NEW
3.6K 34.0 336.0 135 KB

It counts how many times your GitHub profile has been viewed. Free cloud micro-service.

Home Page: https://komarev.com/sources/github-profile-views-counter

License: MIT License

PHP 91.67% Dockerfile 3.60% Makefile 4.73%
github github-profile github-counter counter visitor-counter views-count view-counter gh analytics github-profile-counter

github-profile-views-counter's Introduction

GitHub Profile Views Counter

GitHub Profile Views Counter

Discord License

Introduction

Try Ÿ HŸPE service as the more robust and feature rich solution.

GHPVС project is proof of concept. This counter designed to be an analytical instrument for you, but not for people who are visiting your profile. It could be used to see profile views dynamics as result of development activity, blogging or taking part in a conference.

It counts how many times your GitHub profile has been viewed and displays them in your profile, for free.

antonkomarev-profile-views-counter

Usage

Cloud solution launched as 100% free experience. Help me cut server costs if you like this service.

If you want to see big numbers in your profile, deploy a standalone solution to draw any views count you want without spamming our server. Everybody knows that any counters could be faked.

A billion fake profile views doesn't make you a very popular person, it makes you a person with a billion number in the counter.

Create GitHub profile repository

GitHub magic will happen as soon as you will create a new repository named equally to your username.

secret-profile-repository

Live demo of my profile repository.

Add counter to GitHub profile

You need to add counter in README.md file in your profile repository via Markdown syntax:

![](https://komarev.com/ghpvc/?username=your-github-username)

NOTE: Don't forget to replace example your-github-username parameter with real value.

Make it personal

Color

You can use any valid HEX color or pick from a predefined set of named colors (blue is the default).

color demo
brightgreen
green
yellow
yellowgreen
orange
red
blue
grey
lightgrey
blueviolet
ff69b4

Named color

![](https://komarev.com/ghpvc/?username=your-github-username&color=green)

Hex color

![](https://komarev.com/ghpvc/?username=your-github-username&color=dc143c)

NOTE: HEX colors should be used without # symbol prefix.

Styles

The following styles are available (flat is the default).

style demo
flat
flat-square
plastic
for-the-badge
![](https://komarev.com/ghpvc/?username=your-github-username&style=flat-square)

Label

You can overwrite default Profile views text with your own label.

![](https://komarev.com/ghpvc/?username=your-github-username&label=PROFILE+VIEWS)

NOTE: Replace whitespace with + character in multi-word labels.

Base number

You can provide a base number to add to the counter. This is useful if you are migrating from another service.

For example, a user with 1000 views on another service who wants to migrate to GHPVC will use the following url to ensure the 1000 views are accounted for:

![](https://komarev.com/ghpvc/?username=your-github-username&base=1000)

Abbreviation

You can set the abbreviated parameter to true if you would like the counter to be abbreviated.

For example, a counter with 12345 views, will be displayed as 12.3K.

![](https://komarev.com/ghpvc/?username=your-github-username&abbreviated=true)

FAQ

Can I see detailed statistics?

This project provides minimalistic counter only. Use Ÿ HŸPE service if you want to get detailed info about:

  • user profile views
  • user followers history
  • repository stars history
  • repository traffic for longer than 14 days

How to reset counter?

To reset counter you should log in to the Ÿ HŸPE service, and then you will be able to reset counter on the https://yhype.me/ghpvc page.

Why does the counter increase every time the page is reloaded?

This is counter of profile views (page hits), not a counter of unique visitors. There is no way to get the username, browser user agent or IP address of the visitor because GitHub proxies all image URLs through the GitHub Camo service. In other words, we can only increment the counter for each request from the GitHub proxy server, we don't know who initiated it.

Are you making money on it?

No. Only spending it. Become a sponsor if you want it to keep running & receive new features.

Alternatives

  • Ÿ HŸPE enhanced GitHub professional account statistics & analytics

License

  • GitHub Profile Views Counter application is open-sourced software licensed under the MIT license by Anton Komarev.
  • Eye Octicon hero image licensed under MIT license by GitHub, Inc.

🌟 Stargazers over time

Stargazers over time

github-profile-views-counter's People

Contributors

adityabisoi avatar antonkomarev avatar brikaa avatar dependabot[bot] avatar jader avatar reymon359 avatar rizkytegar avatar trkzi-omar 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-profile-views-counter's Issues

Opt-out of hit count

As a normal visitor, I would like to be given the choice to opt-out from getting hits I made counted

Typo!

"lightgrey" is not valid but "lightgray" does work.

Please rename the colour, thanks :)

Profile views increment on visiting other links as well

The profile views are incrementing when a person himself/herself visit their own profile. Even apart from that, the profile views are incrementing when you are opening any other link on your account like explore, issues etc. So basically, everytime when you click on your mouse to visit any link on github, the views are incrementing. I think, they should only increment when someone visit the profile only.

[Feature suggestion] Timeline counter view

It would be nice if their was a time line (like contributions timeline on Github repo) where a use could see a timeline of the number of visitors on a GitHub profile such as per month or per year.

This could be a better indication of profile traffic vs total view count all time.

If there is another free service let know otherwise :)

Format number?

What do you think about the format number in the views counter?
Schermata 2020-07-22 alle 17 34 04

2938 => 2,938?

There occurs a problem with the display of the icon

Description

I have been using github-profile-views-counter to count my page views for a long time. Yesterday I discovered that there was an error in the icon display.

Detail

image

The code I use

<p align="center">
  <a href="https://github.com/lim-yoona">
    <img src="https://komarev.com/ghpvc/?username=limyoona&color=blue&style=flat)" />
  </a>
</p>

and using markdown code also has the same effect.

Condensed Counter View?

Noticed that the counter "shrunk" all of a sudden. I was at 2k views, nothing crazy big for the container to suddenly overflow. Attached screenshot below

Screenshot 2023-10-10 at 2 40 48 PM

[Enhancement]Counts a person's own view as well.

Hi Anton,

You have made a great project but I think with one enhancement it would be perfect. The counter considers the user's own count as well. Would it be possible to clone this project to another repo and make a slight enhancement to it? Or if you can incorporate the enhancement in the same repo it would be very helpful.

I am a novice in programming so apologizing beforehand if this issue is laughable 🍡

How to set the initial value

As I am migrating from another service, I would appreciate having an initial value set up.
Does it support this feature?
Thanks~

Profile viewed zeroed

after the yesterdays issue my view count resetted. is anyone else experienced same issue?

profile views

for every refresh from same machine, i have seen profile views getting incremented,
not a big issue at all,
its maybe work as expected,
just want, you to know!!!
(we can check ip address and then only increment)

Thanks,
Ashish

Website down?

Badge doesn't show up for me and the website is not available aswell

Adding a way for people to reset their own badge

Would it be possible to add a way for people to reset their badge? Authentication could be done using OAuth2 to make sure people only can reset their own badges.

This would be useful for example if you edit your readme a lot, and go back and fourth between the editor and preview tab. Each time you then go to the preview tab it increases the counter. That's why my counter is approaching 100, even though im likely only at like 5 (10 if im lucky)

How to ignore own profile views?

Currently, the GitHub profile view counter increases counter by one when a user reloads his GitHub profile page. For more accurate counter it should exclude profile views by the owner of the GitHub repository.

Error fetching resource

Is the link down?
Image not showing up?

<img src="https://komarev.com/ghpvc/?username=impratik7&label=Profile%20views&color=0e75b6&style=flat" alt="impratik7" />

[Feature suggestion] Add new style for social: `?style=social`

You currently have these styles, and they are very useful:

style demo
flat
flat-square
plastic
for-the-badge

However, shields.io has one other style available: social. See more info here.

For example:

style demo
flat
flat-square
plastic
for-the-badge
social

But when I try to use this for Profile Views:
![](https://komarev.com/ghpvc/?username=chrimaho&style=social)

Can you please also add this ?style=social function to your repo?

Thank you!

YHYPE Website down?

I've tried visiting https://yhype.me on many devices and it doesn't seem to be online whenever I try. My browser keeps saying the server took too long to respond. Do you have any insight or am I missing anything?

view count reset to zero

A few days ago, the view count was still 8k, but today I found that it has been reset, and I have not changed any settings and styles

Write console command to re-calculate counter aggregate value

After fix (by @Brikaa) of counter reset because of the race condition (#66) we need to create console command which will re-calculate correct counter values. It should count lines in storage/{username}-views file and store them to storage/{username}-views-count.

Something like:

cat storage/{username}-views | wc -l | tr -d ' ' > storage/{username}-views-count

But we should iterate thru all the usernames in the storage directory. There are many counter files, so ls -la is hanging for a long time.

One more thing to ensure: we need to make -1 from wc -l, because of the empty line at the end of file.

Badge displays weirdly on Edge

When viewing the Profile Views badge in Edge is there a odd gap between the "e" and "w" of "views". (See image)

I doubt that it's a browser thing,

image

Image Not Showing

https://camo.githubusercontent.com/d623505e1cfd15c17382a974e808708e996776ed7cabc5780ca50600cc5df7c1/68747470733a2f2f6b6f6d617265762e636f6d2f67687076632f3f757365726e616d653d72697a6b797465676172266c6162656c3d72697a6b7974656761722b70726f66696c652b76697369746f72

Is it an error?

when I open the url above it will display a message like this.

Error Fetching Resource

it also doesn't show up on my profile

   <img src="https://komarev.com/ghpvc/?username=rizkytegar&label=rizkytegar+profile+visitor">

Only showing broken image icon

Free public hosting

Does anybody knows a good stable free public cloud database which can hold this service data? Right now it requires 40GB+.

[BUG] The counter resets?

1 - A week ago I had the counter around 2000-2250 views, then for some reason it appeared with only 2, I think this started when I changed the style to for-the-badge

2 - I have also noticed that when you refresh the page with the counter it increases x2, that is, if you have 2 views, and you update you will then have 4, then 6, and so on...
dung3

SSL Certificate Invalid/Expired

GitHub no longer displays view counter badges due to a problem with komarev.com's SSL certificate. Chrome throws the NET::ERR_CERT_DATE_INVALID error. Pretty sure the certificate expired.

Race condition vulnerability causes counter reset

A user's counter can be reset by spamming requests, this happens due to a race condition while truncating and writing to a file. The following NodeJS script can be used to reset a user's counter:

// Send requestsPerBulk requests in parallel (let's call that a bulk)
// Wait till they are done
// Repeat till a total of bulks * requestsPerBulk requests

// After each bulk, output the number of succeeded requests and the number of failed requests
(async () => {
  const url = process.argv[2];
  const bulks = parseInt(process.argv[3]);
  const requestsPerBulk = parseInt(process.argv[4]);
  const headers = new Headers();
  headers.append('User-Agent', 'github-camo');
  for (let i = 0; i < bulks; ++i) {
    const promises = [];
    console.time('bulk');
    for (let j = 0; j < requestsPerBulk; ++j) {
      promises.push(fetch(url, { headers }));
    }
    const results = await Promise.all(promises);
    const failed = results.filter((res) => res.status >= 400).length;
    console.log(`Bulk ${i}:- failed: ${failed}, succeeded: ${requestsPerBulk - failed}`);
    console.timeEnd('bulk');
    await new Promise((r) => setTimeout(r, 500));
  }
})();

Run it as

node script_name.js ghpvc_url 50 20

and observe the counter, it will reset at a certain point in time.

Here is an explanation of the race condition that happens according to my understanding:
Requests need to do the following:

  • Read file, increment number
  • Truncate file
  • Put incremented number

The following race can happen between two requests (A and B):

  • A: read file, increment number
  • A: truncate file
  • B: read file, increment number (oops read empty file, number is zero, incremented number is one!)
  • A: put incremented number
  • B: truncate file
  • B: put incremented number (oops put one!)

This can be fixed by using a lock on the views-count file or by migrating to using a database management system that automatically handles concurrency issues.

Visitors are not unique

image
After refresh
image
Adding a session style system would be great! I have worked on it, but since i have no clue which file is the one every user goes too i added session_start to every file ! Please tell me if some of the files don't require this , and thanks to you and the great PHP community!
The best of luck

Adjust the font size

Thank you for this repo! Simple and professional. I am making my img tag larger to fit better with my readme, but I was wondering if it is possible to implement a font size feature.

Thanks again!

Server error while trying to sign up

Hi,

I'm trying to sign up but get a SERVER ERROR message displayed
image

I'm not sure what to do from there. I tried incognito mode, without browser extension but the same happens.

Thanks in advance

500 SERVER ERROR

When attempting to access the page of https://yhype.me/, I frequently encounter a "500 Server Error." This issue seems to be occurring consistently in these two days.

image

[Feature suggestion] Ability to change label color

As far as I know there is no way to change the label color (left part).

I think it might be a great feature to be able to add &label_color=FFFFFF to further customize the counter.
FFFFFF: the value of the color in hex.

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.