📜 ⬆️ ⬇️

Social share buttons pluso flew off, I had to make my own

Until recently, we used PLUSO - this is such a free service, generating a script that allows site visitors to publish links to your articles in social media (bookmarks, social networks). The service looks like buttons — social network icons; Easy to install and looks good. But a fly in the ointment was found in this barrel of honey. Pluso connects a bunch of unnecessary files , which pretty much slows down the work of the resource on which these buttons are located.

We spontaneously decided to write such buttons for our site. I had to write a bit, the server is on nodejs, the database is redis, everything works quickly and does not load the site, unlike pluso. And one more minus pluso - the lack of documentation, for example, how to track the closure of the pluso window - is not known to anyone. In our buttons, we added an onclose event, which is triggered when this window is closed.
This morning we found that the social share-buttons pluso broke! When requesting share.pluso.ru/pluso-like.js, a 502 error is displayed and, as a result, a lot of sites are left without their favorite share buttons.

image

But as it turned out, this is a temporary phenomenon, and by the time this article was written, pluso was working again. Nevertheless, we decided today urgently on all pages of our site to replace the pluso with our buttons.
The design was borrowed from pluso, but this is temporary, while testing and writing is in progress, we will soon draw our own.
The only site where you can now see our buttons is stairschat.com . After replacing the pluso with our buttons, the site has become much faster to work.
You can install our buttons on your own to test them or just to see how they work - literally, with two lines of code.
')





In the near future, we will write a code generator + a bunch of options for buttons, but for now there is no generator, instead of randomID, you just need to insert a random string (preferably no longer than 8 characters), a list of social data is recorded in the data-services. networks that we will use
data-title - title
data-url - link to the page
data-description - page descriptions

If randomID coincides with several instances of buttons, they will have a common counter.

I would like to criticize the button code.

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


All Articles