track and present profile views on GitHub

track and present profile views on GitHub

As fragment of contemporary invent changes, GitHub has introduced READMEs for profiles. By increasing a repo with your title and adding README.md file with markdown to it, that you just can perchance now add a rich description of your self.

Right here is an example of the map it appears to be like cherish:

Python reference count graph

This selection can also now no longer be readily obtainable to your profile yet. GitHub makes relate of selectively rolling.

Now not like the worn hideous-text bio discipline, the contemporary feature helps exterior links and photos. That is where it will get keen.

Tracking profile views

Since Github’s markdown can present photos from exterior sources, that you just can perchance now track and present views of your profile.

To map so, it be indispensable to host an image for your server and present it by map of Markdown syntax:

![image title](https: //rushter.com/counter.svg)

On the server-aspect, each image ask could additionally be treated as a view of your profile. The leisure of the story is easy — it be indispensable to store a counter within the database and return an SVG image with the gathering of views as a response. For sure, there will be some further requests from bots, nevertheless having such statistics is healthier than nothing.

To forestall IP and Consumer Agent leaking, GitHub caches all photos by map of special proxy. To put faraway from being cached on Github servers after basically the most indispensable image ask, your image need to specify cache headers or return non-200 response (e.g., an HTTP 404 page).

Right here is the HTTP header that disables caching:

Cache-Take care of a watch on: max-age=0, no-cache, no-store, need to-revalidate

That is now no longer something contemporary for repositories since they’d this means for a long time, and GitHub permits this more or much less relate of photos for interactive badges. Now not like profiles, repositories have entry to traffic statistics too.

Right here is the map it would see cherish at the same time as you have entry to the contemporary feature:

Python reference count graph


There are libraries and products and services that can map this for you.

Safety aspects

For a form of folks, permitting exterior photos on their websites sounds cherish now no longer a immense deal. I have been using this methodology to trace profiles views on quite about a platforms for higher than 10 years. I’ve seen how recruiters continuously refresh my profiles after they wish to bring collectively a resolution :).

Now not like GitHub, most of them produce now no longer even trouble proxying the image to cowl IP, referrer, and browser agent. In converse so that you just can enable exterior photos for your plot, you need to proxy them and cowl the entirety about a particular person that requested it.

A particular person with harmful intentions can trick a victim into opening your profile that appears to be like fully legit and detect his IP and a browser. It’s essential to perchance additionally situation a cookie to trace particular person visits on the different websites, nevertheless browsers will soon quit doing it.

A single-pixel image can provide you a form of files. That is how your entire AD industry works when it tracks your visits on quite about a websites.

Conclusion

In accordance with my exams, profile views map now no longer depend as repo views, and I’m hoping, in due direction, we are able to be in a reputation to explore traffic stats within the repository that hosts the README file.

Learn Extra

Leave a Reply

Your email address will not be published. Required fields are marked *