📜 ⬆️ ⬇️

Google buttons "+1" on Habré, userscripts and improved search for yourself and your circle

We continue the month of Google+.

Buttons Google "+1" on Habré yet. But there would be a desire - they can be installed and tested using a user script. The article shows how the "+1" user-script buttons are installed and how the results of Google search results change when you turn on the "+1" from your account.

(in the picture it is not a montage, it is a real working script)
(see UPD3 with a newer HabrAjax user script for the site containing all the described functionality).

While the administration of Habr is not in a hurry to put this button. In fact, there is something to think about. The Google button loads a lot of third-party script, making the page heavier. The button itself shows its values ​​not immediately, but after 2-5 seconds, until the data is loaded (as many requests as there are buttons). To the basic 2-kilobyte function, another 20-kilobyte (with ssl.gstatic.com) and 10-kilobyte is loaded from the same place. 1 KB supercoded style, very rich and abbreviated. And then, after a thorough arrangement of the entire economy on the page, JSON comes in at 200 (at least) bytes, apparently, with meaningful data. If now you open the browser with a dozen previously opened pages of Habr, then these scripts are loaded into each of them. And it would be okay, they only loaded - they are still executed in each window, selecting CPU time and delaying the execution of other scripts.

But we, nevertheless, put these buttons for research purposes and see the results.
')

Download experimental script


Install habr script for google buttons "+1".
spmbt.kodingen.com/habrahabr/habracut06.user.js
This script contains many other extraneous actions - viewing Habr's articles without reloading the page, and is in beta state. But yesterday, it was added to the opportunity to put the buttons "+1", and this is what is required of him.

Buttons appear both on individual pages and on group pages with a list of article titles, such as the main Habr page.

( Warning. In the future, this script will be improved. For example, it now loads the Google+ scripts on any Habra pages. This is wrong for the final result, but normal for beta, and will soon be improved. Therefore, if you don’t need the script, should be disabled in the browser settings (Add-ons, "Extensions", Manage Site Preferences and similar settings items of different browsers.) If you do not want to search later on where to disable it - do not put it.)

If the script needs to be updated in the future, it must be done after clearing the browser cache or adding an arbitrary new line to the URL (for example, "? 123") to bypass the caching.

For convenience, the user-style Habr Prettifier / spmbt is installed , so the screenshots are non-standard, but without it everything will work, only significantly different in appearance.

The user script is tested and works in Firefox 3.6 and 5.0, Chrome 12. It works, but cannot change the state - in Opera. It can work, but not tested in Safari (you need to install it there either through NinjaKit, or directly in the settings). To install in Firefox, use the Greasemonkey or Scriptish plugin. For Chrome, there is no need for plug-ins, just open the script and accept the installation.

Checking the operation of the button on Habré with Google search engine


For verification, take the page with the article "Cross-Domain AJAX Request for Opera." From 2008. Without the button set, the ajax opera request finds a link to it on page 10. Now we include the user script, reload the page and see the "+1" button.

After installing the script at the end of the article after 3-4 seconds the "+1" button is loaded.


At first, it is marked inactive. After clicking on it (check that the tooltip says it is about your Google+ account), it changes color.

(now the buttons are reduced to the size of "small" and look like in the screenshot at the beginning of the article)

Push it, and after a few seconds go to see the results. Our article is found on the 1st page at about the 7th place.



We try a similar query: "query opera". The result is in 6th place.

Disable the "+1" and see what happened in the search for "query opera". When entering without an account, the result is in the 11th place, and during authorization, in the same 6th place. It is not known whether a place is remembered for a recent Google+ or for some other reason (targeting). For example, after disabling the "+1" request "ajax opera" again failed to answer the 10th page.

Similar experiments with other buttons have shown that upon request from the words of the title, we almost always see in the output the pages marked by us, unless the words of the request are not very common. It can be expected that the marks of people from their circles will also be shown in the issue as their own or almost as their own.

If we take very common words, we don’t find our own "+1" - millions of words "ajax" or "opera" separately - win.

Work in the Opera


While the script runs in Firefox and Chrome and performs all functions, in Opera it also starts, but when you try to mark "+1", the icon turns red, with a hint that some kind of error has occurred. Let us write it down to the unusual and unforeseenness of the manufacturer of this method of installing the script, as through a user script. (The launch in Chrome also didn’t happen right away.) Moreover, we know how Google relates to Opera. :)

Will their marks be seen by strangers and how fast?


I spent a simple experiment, the results of which puzzled. Having marked "+1" on a completely normal site (not on Habré), I did not see a quick reaction to my "+1" when entering without an account or under a different account. That is, when the button reacts instantly to itself, for outsiders this reaction at least slows down.

For Habr, respectively - the same story. Noted under your account - great, and the search results immediately changed. Disconnected - everything came back. But it is worth looking under a different account - there is not 1 noted, but 0.

I do not have a second account on Google+, so I can not say what will happen if a person from his circle looks at the mark. This is a very interesting question, and it is after a positive answer that you can make far-reaching positive conclusions - use the buttons to search for content by a group of people in the general circle. Probably, there will be enthusiasts who will agree to connect to my circle for search experiments on words like “web programming, CSS” and add me to the circle themselves, and then there we will discuss the results on Google+.

Account to connect to your circles: gplus.to/spmbt . Request: do not connect for anything other than web development and programming, an account is created only for this :).

Findings.


It turns out that links that are not very drowned in this search query (2-10 pages) rise very well to the 1st page, if you have noted it. Links that are already on the 1st page of the search, raised slightly. The rise happens instantly, without crawling the pages “in about a week”. Therefore, such buttons will be convenient to raise your search ranking for the pages you viewed.

Will this work if a friend listed in a Google+ circle has noted? Google claims that it was for this technology was developed. However, there is some lack of thought due to the fact that marks for people not from the circle are taken into account, at least not immediately. Perhaps this is the cost of a new technology. Perhaps - the time required for processing.

Thus, if a society of people with common interests, even having no invites to Habré, but in adjacent circles on Google+, will meet on Habré, their article marks will be much more relevant than the rest. So, you can experiment with a set of communities in circles with common interests, for example, in programming. A person starts an account on Google for the purpose of grades solely for work, enters the “right people” among the circles, and as a result, a powerful search engine is obtained from the marks of those people whom you trust.

Further, the user marks the pages that interested him, and later, making a search for relevant words, easily finds these pages. Familiarity of his circle also help to make search useful pages.

If the sites do not have a Google+ button yet, the script expands quite easily to appear on every site at all. (Greasemonkey has a “script command” menu in which you can write a “+1” for each site.) The question remains whether the current button will heavily load the computer with its work on each page.

Of course, this is a roulette, which now works, because it is not littered with advertising and other search engine policies, but it’s worth a try.

UPD (7:00 pm): Added to the script a minor update that allows you to watch the number "+1" on a non-group page. It turned out (by experience) that the “href” parameter is very important for this, so that it is the same for all buttons that we want to see the same.

Nothing else affects but a single page. Who wants to - update the script (not forgetting about caching or "? 123").

I opened my "+1" on my account so that those who wish can see if it affects the issue if I am in his circle or not. Who else will open their "+1" for this purpose? Unsubscribe, please, I want to check.

FAQ on the "+1" button: www.google.com/intl/ru/webmasters/+1/button .

A bit off topic:
image

UPD2 (11:00, on the following day, July 14): Fixed a bug caused by the absence of the author of a post on Habré (a case of error this morning post habrahabr.ru/company/google/blog/124115 ), update the script.

And more reasoning as one of the conclusions.
1) It seems that you need a script that will work on the "likes" of various services and provide the user with only those with whom he works (and, if desired, describe the merits of others, so that he can connect). For example, for Habr, this means that if you do not use Twitter, the “t” buttons disappear, and if you use LinkedIn, its button appears in the place of “likes”.
2) Favorites - a kind of "like";
3) if the likes are one per page, then they may be outside the page, like a browser interface button (just like it was done in that +1 Chrome plugin);
4) if the links of the link are not equal to the link of the page, this should be taken into account by the plugin.

UPD3 , a few months later, 18.2.12: approximately from mid-December 2011, the HabrAjax user script for all modern browsers is active , which enables or disables the upload of Google+ buttons in its settings.

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


All Articles