📜 ⬆️ ⬇️

Habrometr - a new service for logging and displaying the values ​​of karma and habrosila publicly open

Habrometer - a service for logging values ​​of karma, habrasils, positions in the ranking of a habrew user and displaying this information on informers, which can be inserted into a profile, blog, forum, etc.

Many habrip users have long been aware of this service, are registered on it and posted their Habrometers on the network. They know about it because about a month ago I already published information about the service in a private blog I ♥ Habrahabr. After that, much has been reworked, bugs fixed, optimization performed. And now it is time to talk about the service to all habrau.

feedbee
')

First, I repeat a little for those who are not connected to the blog about the love of Habr and did not see the first article.

For the purpose of observing karma in time, the Goodrone Karmagraf has long been written. But its development is now frozen, and the engine itself broke down in its time and the values ​​of the counters have not been updated for a long time. This prompted to write your karmagraf, despite the fact that the first karmagraf was already repaired.

I do not know whether to consider the word “Karmagraf” itself as the name of a specific service from Goodrone, or as the name of a class of services (or the graph itself). In order not to bother with this question, I decided to call my karmagraf differently - Habrometer. After all, he considers and shows not only karma, but also habrasil and position in the rating (all that the Habr API currently gives out). Habrometer differs from the Karmagraf in spite of the visual similarity of the design of the main informer. Of course, I tried to take all the best from Karmagraf. The main difference of Habrometer - informers of several different types. Already available 6 options in size.

What came out of this can be viewed on the service website. Now on the site after registration, each user can get the codes of their Habrometers. Every 2 hours the server collects the values ​​of karma, habrasils and positions in the rating of each registered user and stores them in the database. While the shelf life of the history is not limited, and on the user page you can see the average values ​​by day for the last 90 days.

All scripts are written in PHP, the database is used by MySQL (for now anyway). To draw using ImageMagick. To run on a schedule - Cron. Web servers nginx and apache. Caching - memcache.

The service runs on my server, which, by the way, is not very powerful and can not withstand the habraeffect. By the way, from a technical point of view, there is one significant difference between the work of Habrometer and Karmagraf - informers are not drawn according to the schedule after the jump of fresh data, but at the first request to display the informer after updating the data. In other words, after the informer is drawn, it is cached. The drawing itself is pretty fast. And the cache is cleared after the download of fresh data. This allows you to spread the peak load on the drawing of fresh informers in time, since it is quite expensive to generate all 6 informers for all users every 2 hours. In addition, not all registered users in general will place informers somewhere, and even less will not place informers of all sizes at once. True, this method has a big drawback. It is not resistant to flashmob effects, as requests for drawing a large number of informers can be received at a time.

Naturally the service is provided "as is" and is free to use. Habrometer sources are open under the GPL 3 license. And this means that everyone can place their habrometer on their server, or upgrade their public service. Personally, I will only be happy with the emergence of alternative servers.

Now the service continues to work in beta testing mode, although the versions are already more or less stable. I will be glad to receive your feedback, bug reports on e-mail feedbee@gmail.com.

In the plans, as time is available, it will be necessary to come up with something with the expansion of the colors of the informers, to make the normal design of the service site.

If someone is ready to help with the code (optimization, refinement) or design - I will be glad, since my free time is very limited: (

PS If due to habraeffekt my server will be covered, no longer throw a lot of stones in the garden. I am limited in server resources.

Source: https://habr.com/ru/post/51978/


All Articles