DEV Community

Discussion on: Add a visitor count on your GitHub profile with one line of Markdown

Collapse
 
ryanlanciaux profile image
Ryan Lanciaux

Refresh is a new view of the page :) it’s working as intended

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

So, this is also a new view of the page! 😄

curl https://profile-counter.glitch.me/{YOUR USER}/count.svg
Thread Thread
 
ryanlanciaux profile image
Ryan Lanciaux

Curl is pretty cool 👍

Thread Thread
 
jonrandy profile image
Jon Randy 🎖️

You'd be better off checking the referrer to make sure the image was loaded in the context of the page where the counter is. Otherwise, you're just counting 'loads' of that image - wherever they may have come from

Thread Thread
 
ryanlanciaux profile image
Ryan Lanciaux

A referrer check would work in many contexts, however, the primary intent of this project is for use on GitHub. GitHub has a caching later that prevents tracking docs.github.com/en/github/authenti... - this is a “for fun” project that I made quickly in hopes people would have fun with it on their GitHub profiles. If this were a commercial product or an analytics package that was not for use on GitHub, I would check the referrer among other things.

If you are interested in making changes (as a new project), the code is available in the prior article mentioned above (noting there is no database in that version)