Advanced Yandex (and Google) search using an installed script or in the interface. We write scripts to automate work with Google applications. Setting up a client channel to monitor the effectiveness of advertisements on the search results page.

The Yandex search engine, like Google, has advanced search settings (by dates, documents, sites, country, language, ...) and special pages for advanced search. Both can be inconvenient due to the interface - a large number of pressed buttons, clicks and movements. For some (frequently used) search modes, user scripts were made with the choice of one of dozens of buttons in one click. Only a few start buttons are visible on the screen, working as drop-down lists on mouse hover.

Such a script, which once had no drop-down lists, has been working on Google pages for a long time, and, judging by the number of downloads, has gained popularity among English-speaking users (there is a choice of 5 interface languages). One day it was thought that it would be easy to transfer it to Yandex, and over the weekend, in a couple of days, adaptation and repainting to match the colors of Yandex was done, and now it is presented to the “target audience” - people from IT, who sometimes have to search a lot and who are accustomed to installing additional scripts and go to git hubs.


In addition to its utilitarian benefits, the script can be interesting as a testing ground for testing interface solutions. A bunch of 2-3 scripts in the future can begin to work as a meta-search engine, everything for this is already there, except for the finishing touches - installing connecting buttons, porting to mailru and other search engines.

Now let’s look at what Yandex features have been added to the previously existing solution for Google.

The first and only limitation of Yandex that catches your eye is no search for the last hours. Most likely, Yandex does not yet have such functionality; the question on toster.ru did not bring an answer, but now, perhaps, developers from Yandex will write something in the comments.

There has also been an expansion of functions in document search - the Yandex query interface allows search by document type group(multi-select in the settings), and Google each time - only one type of document (PDF, DOC, SWF, ...).

Otherwise, the special settings mode overlaps so well that it made it possible to make not only the interface, but also the storage of settings parameters similar. This is a search by site (domain) and search for the last time interval (more than a day).

Details of storing settings - a solution with external localStorage Previously, Google acquired a similar extension for storing search settings. Simply because it is sometimes desirable to change the list of your domains or the interface language, and changes directly in the script are not enough, which is familiar only to front-end programmers; also, with fairly frequent updates, there is no way to save the code of part of the user-corrected script from the general update. If the settings stored (in localStorage) appear, then the issue is resolved.

But then Google discovered a habit of erasing local memory! Facebook users have encountered this before, and to solve this problem there was a script for a different reason (bookmarklet of bookmarks with window scrolling). Here, similarly, it was necessary to run from the Google domain somewhere to another domain where the cleaning scripts could not reach. Communication was organized with a quiet, modest page on github.io, where everything was securely stored, almost like in a bank. (This link will be useful after installing the script to see where the settings were saved.)

For Yandex, this resulted in the storage of its settings also being done on the same domain (github.io). This immediately led to the fact that 2 different scripts, different domains and different search engines acquired common settings. No, it’s extremely easy to separate them, but why? The list of favorite sites for searching, the interface language, and subsequently the storage of the latest date intervals - all this began to appear the same in both Google and Yandex, provided that the same browser was used.

It is this mechanism that now makes it possible to very simply do a metasearch - add a field for commands to the saved settings - just the command “search” or “search with settings”, or “search in selected search engines”). In the future, you can imagine that there will be synchronous management of cards, and viewing in sections, for example, news, pictures. Agree, it’s convenient to walk around the map in one window, and in the next window to have a synchronous copy in Google Maps in order to switch to the window where there is more complete information. And the display of pictures will be noticeably different and complementary.

Directory of advanced search options in Yandex and Google This list may be supplemented by specialist users and company developers (I’ll add them based on comments or PMs).
All methods and types are listed in order to organize a small reference book.
Much is not implemented in the user script interface. What has been implemented is indicated. In Yandex:
  • by region
    in the interface- a field with hints where you select a “region” - country, region or city;
    in the request- &rstr= with a signed magic multi-digit number that matches another undocumented lr parameter for its region; not everything works - for example, searching for Manila (rstr=-10629, this is the Philippines) is not much different from the general one;
  • by site or domain
    in the interface- enter the domain name in the field (2 or 3 levels, without continuation)
    in the search bar- write (without quotes) “site:3dnews.ru” or similar;
    Yandex Extra Buttons - a drop-down list of pre-registered domains under the “site” button. The composition of the list can be changed in the settings, through the button site--Settings--settings form--page reload. Saved in external localStorage. It is useful to copy your list of domains for storage, transfer to another browser, and for recovery.
    in the request- &site=anysite.ru ;
  • around the country
    in the interface- the button with the meaning “own country” is switched, i.e. on domain.by this is the choice of “by” and nothing more;
    in the request- &country=by , while you can specify some other countries for which Yandex works, but which of them actually works is not documented. For example, &country=tr or com.tr does not work, like many “not close” countries, not necessarily small ones;
  • exact request
    in the interface- a separate button in the subheading or on a special page;
    in the search bar- frame all words or part of them (constituting the exact part of the request) with quotation marks;
    in the request- &wordforms=exact
  • by page language
    the choice of languages ​​is small, but it covers all countries where Yandex is present as a separate competing search engine, plus English, German, French; (this list may be a candidate for another button in the userscript, but how many people use this setting? Most likely not);
  • by type (plural) of documents
    in the interface- select from a multi-select list; with each click, the Ajax output changes (without rebooting); on the advanced page - select types from 14 (currently) checkboxes;
    in the search bar mime: pdf" or similar, many types are supported, but one per request; interestingly, this type selection is NOT supported by subtitle scripts - apparently this is an older way of selecting a parameter;
    Yandex Extra Buttons - a drop-down list of pre-defined document types under the “PDF” button, which itself also selects the specified type; when clicked, the page picks up the results and changes the list of selected types in the subheading; the script fixes a display bug - tints the types button if at least one type has been selected; Thus, the user script buttons, in fact, initiate “clicks” on types in the subheading, do not themselves display the results of multi-selection, but work without a subheading (it appears itself after the first click);
    in the request- &mime=rtf or &mime=rtf%2Cdoc , indicating all selected types; works &mime=rtf&mime=doc and so on; requests go via AJAX, but with the main one you can send a non-Ajax request in the same way;
  • by last date interval
    in the interface- 3 separate buttons in the subheading or 5 on a special page;
    Yandex Extra Buttons - 4 drop-down lists in the form of initially small 4 buttons - selection for the last few: days, weeks, months, years. The selected value is saved in the settings and moved to the top of the list, so that when you make the same selection again, you only need to press a button. Technically implemented through a request for an arbitrary date interval (section below), the page performs the request using AJAX, but from the main page it works like a normal page reload;
    in the request- magic parameter &within=number for some intervals; for example, &within=1 - within 2 weeks; 77 - per day, 2 - per month; 3 - within 3 months; 4 - for six months, 5 - for a year, 6 - for 2 years, etc., 7 - for the current day, 8 - for 3 days or 4 days (not known exactly, not verified), 9 - for 8 days; you can check that on the resulting page the interval is indicated accurate to the day, and the results - accurate from hour to day;
  • by date interval
    in the interface- 2 fields with date pickers (tables for selecting dates from the calendar);
    in the request- &from_date_full=01/11/2016&to_date_full=01/19/2016

There are a number of other more specific parameters, query language (for example, negative keywords and the mentioned quotation marks), which we will not consider, but some of them may appear in the interface of the advanced search user script. In addition, Yandex has a number of page types (pictures, videos, news, Market, etc.), where queries can have specific features (for example, there is a search by image, search for a geographical location on a map). The script now covers the main field - text search.

In chapter Yandex news the advanced search is based on other parameter names, and the script is not executed in this section at this stage. Google has the same rules for constructing queries in the news section; the Google script works in all its main sections.

In Google: Interestingly, different query parameters give the same results, but in 2 page designs - with a black header (older) and with a white one. The quality of output is most likely the same. The advanced search page now returns an answer with a black title, and this is not necessarily true for different countries. (It is also known that doodles issued at different times for different time zones.)
  • by document type (singular)
    in the interface - advanced_search- file type:
    - one of 10 formats; a text query can search for other types besides those named in the list;
    in the search bar- add (without quotes) “filetype: pdf” or similar;
    Google Search Extra Buttons - so far it has been made as 2 separate buttons (without lists) for PDF and DOC (other types in Google are quite convenient to set in the search bar, so many types of documents were introduced only starting with the script for Yandex);
    in the request- &as_filetype=xls
  • by last date interval
    in the interface - Search Tools - (Any Time | Past), then - 5 options to choose from, or there is an option to specify any date interval here or on a special page;
    Google Search Extra Buttons - 5 drop-down lists in the form of initially small 5 buttons - selection for the last few: days, weeks, months, years, hours (in addition to the same in Yandex). The selected value is saved in the settings and moved to the beginning of the list, so that when you make the same selection again, you just need to press the button;
    in the request- 2 types of queries with the same results, but with different search page designs
    &as_qdr=m2 - view with black title;
    &tbs=qdr:h1 - newer view; instead of “h” put h, d, w, m, or y; number - the number of dimensional units or empty, which will be equivalent to 1;
  • by date interval
    in the interface - Search Tools - (Any Time | Past ) - Custom Range...; on a special page - selection only by the last few date intervals (section above);
    Google Search Extra Buttons - a separate button that immediately calls up the interface form; on the main page there is no support for it, so the button is not displayed by the script;
    in the request- &tbs=cdr%3A1%2Ccd_min%3A12%2F29%2F2015%2Ccd_max%3A1%2F5%2F2016 ;
  • by site or domain, including the top level (.com, .cc, ...)
    in the interface- on the advanced search page (gear icon - Advanced Search);
    in the search bar- add (without quotes) “site: anysite.com” or the like, including the top-level domain without a dot;
    Google Search Extra Buttons - a separate button with a drop-down list with pre-defined domains, the list of which can be changed in the settings. When you click on the initial button, it does not initiate a search, but only displays text in the search bar, which is convenient for correcting the domain. Therefore, the first domain can generally be specified as an empty string;
    in the request- &as_sitesearch=anysite.com ;


Other parameters - Google has a number of other parameters for text search and query language, a detailed discussion of which is beyond the scope of the article, but they may appear in the future in the userscript interface.
  • exact word or group
  • any of the words
  • excluding words
  • interval of dimensions (kg, monetary units, years)
  • by page language
  • in the region (state)
  • by location on the page
  • family filter
  • by availability of licenses
The results can be sorted by relevance or by date.
There are a number of search types (pictures, videos, news, maps, ...), where the search parameters will be different or with specifics. Script Google Search Extra Buttons saves the type of the search page from which it was started. On the topic of organizing metasearch for ordinary queries (Next will be plans and fantasies that are interesting to interface developers.)

In its simplest form, metasearch is viewing results in 2 adjacent windows of the same browser. Additionally, you can exclude identical answers from the second window. If you set a goal to get results in one window, you need to decide where in the list to embed list items from the second window. Most likely, it is convenient to embed at approximately the same position that the element occupied in the 2nd window. And, of course, indicate which search engine the answers came from, so that the user accumulates statistics in his memory about which queries from which search engine he received a useful answer.

A note on search engine policy. It is technically impossible to do a metasearch in one window, because modern large search engines strictly ensure that the request is not executed in a frame, so that the answer comes to a real page, and not to an XMLHTTP object. This is due to income from related advertising, which now constitutes the main bread of any search engine. For the user, on the contrary, the result is important and the maximum is the engine that gives it.

Metasearch on scripts is a probability of the near future. For implementation, script codes are available on Github (Yandex, Google), new solutions are welcome.

UPD: Who will help make Belarusian, Kazakh and Turkish localizations?

volume and format

ru:( "search in PDF files":"search by PDF documents" ,,"search in":"search by" ,,"from / to":"for the period" ,,"last":["for the last","for last","for the last"] ,"day":"days" ,"days":["days","days"] ,"week":"week" ,"weeks":["weeks","weeks "] ,"month":"month" ,"months":["months","months"] ,"year":"year" ,"years":["years","years"] ,"hour" :"hour" ,"hours":["hour","hours"] ,"Settings":"Settings" ,"of userscript":"userscript" ,"reload page for effect":"reload page" ,"Interface language":"Interface language" ,"Less positions at the end of selects":"Less choices at the end of selects" ,"Sites":"Sites" )


UPD2 2016-01-22: the primary buttons are made like arrows, in the style of the Yandex button. The screenshots in the article have been replaced.

How to install Google search on a website if you are a complete novice? This is quite simple and does not require special knowledge; the instructions below will help you.

Recently I wanted to add a third-party search form from Google or Yandex to my website, but I settled on the first option, since many webmasters use it and, in addition, the custom search system (CSS) from Google Inc can also be monetized using, well, Thirdly, this is customizing the design of the form itself and the search results; Google will probably have it better.

Where to get Google search code

Method number 1. In order to receive a Google search code for a site, you must be registered with Google or, more simply put, create a gmail.com email address. The creation of a custom search system takes place on the Google CSE service.

Figure 1. Button to create a custom search system

Click on the button and start creating the WBS:

Figure 2. Creating a custom search system

Here you need to fill in 3 fields:

  • Sites on which the search is performed - indicate the domain of your site and its mirrors;
  • Language - select Russian or whichever you need - this is the language of the NGN interface;
  • Search engine name—enter the name of the search engine.

After completing the above settings, click on the Create button.

A congratulations window will open, there are also three menu items:

Figure 3: Google Custom Search created


With this all the settings are considered, let's return to installing the code shown in Figure 4. Select and copy it. I’ll tell you how this script is installed on a website using WordPress as an example.

The easiest way to install Google search code on a website is widgets; in WordPress this can be done using the Text widget:

Figure 6. Text widget in WordPress

The widget can be installed in the sitebar or other available places in your template. To speed up loading, I recommend dividing the IPS code into two parts:

  • The actual script:
1 2 3 //

//

  • And the tag responsible for displaying the form on the blog:
1

I recommend leaving the output code in the widget, and moving the script to a place where it will not interfere with loading the main content of the site, before the closing tag. In WordPress, this tag can be found in the footer.php file.

Create Google Search in Adsense Account

Method 2. Besides the fact that Google search can be created on the Google CSE website, there is another quick method available to those who have a working Adsense account. If you are registered with Adsense, you can get a Google search form in a few steps, and displaying ads there will be set up right away.

Figure 7. My ads tab in Adsense

Select Search and go to the IPS management page in Adsense:

Figure 8. IPS management page

Click on the New custom search system button and go to the WBS creation page:

Figure 9. Creating a WBS

In Figure 9 I indicated the main settings:

  • Name ;
  • Search area - which site will be searched on;
  • Country - indicate the countries;
  • Site language - indicate the language of your site;
  • Encoding - I recommend UTF-8;
  • Transliteration - I recommend setting it to English;
  • Popular queries -

There is nothing difficult when filling them out. Let's look at the remaining 4 points in more detail:


After completing all the settings, we save them and receive the code that needs to be installed on the site. I explained how this is done above.

That's all! I hope I answered the question in full: How to install Google search on a website.

The more your resource is updated with new information, the faster the need to introduce a structured, convenient search will arise. There are several options on how to do this. The first method suggests using the built-in tools of your CMS. The second one is suitable for those who work in pure HTML - for this purpose a special HTML site search script is written. And the third option, the most convenient, proven and, most importantly, suitable for any site, is to search the site through the Google or Yandex search engines. What are they and how are they created?

Features of searching through search engines

There are several good reasons to use website search via Yandex or Google:

  • The first point is that these are specialized search engines, which means their algorithms should be trusted.
  • Secondly, the search engine gives hints, which means it will be easier for the user to formulate his question and find what he needs. Spelling errors in words or accidentally switched keyboards are taken into account using the same principle. The usual HTML site search form will not take this into account, and what you are looking for will not be found.
  • The third important aspect is maintaining statistics. When querying Wordstat, Yandex gives us the frequency of a particular search query. Using this data, we know which keywords to use when filling the site with texts, and we can also analyze what the user is looking for, what is in demand and what is not, what can be offered to a potential buyer, etc.

the search robot will index the content. Until the search spider gets to it, the user will not be able to find it on the site. Such indexing, depending on the resource’s position on the search ladder, can take quite a long time, up to several days.

Search for the Yandex site

The Russian-speaking giant Yandex offers website developers its own free search integration tool. It's quite comfortable. In addition to taking into account the morphological features of the language - correcting errors, typos, searching the site through Yandex allows you to specify a list of synonyms for each word and add a drop-down line of hints. This will allow the user to be more likely to find what he was looking for.

The settings of this tool are very simple; you can select all the necessary parameters yourself. Plus, the tool has flexible settings for the appearance and search elements, which will allow you to design it in the corporate colors and style of the site.

It is possible to search not only text, but also images.

And last but not least important feature. By using search on the Yandex website, you are automatically ranked more often by the system, which allows you to quickly move to the TOP of queries.

How to install Yandex search

It's simple, the main thing is that your site is added to Yandex.Webmaster. It's easy to do.

You need to go to Yandex. Search on the site” and click “Set search”. Next, fill in all the data that the system requires from you, including the name of the resource, e-mail and search requirements. There are hints in the form, so it won’t be difficult to figure out where to check the boxes.

The search engine script will allow you to create your own search engine in a couple of minutes!
A fairly simple search script on the Internet and on your site!
It is distinguished by its simplicity and speed of operation!
It has several search categories: a search on one specific site can be either your site or any third-party site, WEB, Pictures, News, Videos.
A search engine based on Google search, you do not need your own Mysql database for searching, the script works on any hosting, even free ones.
Installing the script does not take much time; you only need a couple of minutes for the search engine to work.
The design can be changed at will; without programming skills, you can easily change the design to your taste.

Technical support and script update.

Reviews3

No feedback received from customers.

In order to counter the violation of copyright and property rights, as well as to exclude unfounded accusations against the site administration of complicity in such a violation, the administration of the Plati trading platform (http://site) appeals to you with a request - if violations are detected on the Plati trading platform, inform us immediately at [email protected] about the fact of such violation and provide us with reliable information confirming your copyright or ownership rights. In the letter, be sure to indicate your contact details (full name, telephone number).

In order to exclude unfounded and deliberately false reports of violations of these rights, the administration will refuse to provide services on the Plati trading platform only after receiving from you written statements of violation accompanied by copies of documents confirming your copyright or ownership rights, at the address: 123007, Moscow, Maly Kaluzhsky lane. 4, building 3, Lawyer's office "AKAR No. 380".

In order to promptly respond to violations of your rights and the need to block the actions of unscrupulous sellers, Plati asks you to send a certified telegram, which will be the basis for blocking the actions of the seller, this telegram must contain an indication of: the type of rights violated, confirmation of your rights and your contact details (organizationally - legal form of the person, full name). The blocking will be lifted after 15 days if you fail to provide the Law Office with written documents confirming your copyright or ownership rights.

Hello, dear readers of the blog site. This is the second article in a series on making money on the Internet () and it will be devoted to working with the Google Adsense contextual advertising system.

In the first article, we learned in detail how to work with advertisements, and also learned about a method of withdrawing money earned in this system, like Rapida (; by the way, I advise you to think about opening an individual entrepreneur).

So, we’ll assume that you’ve figured it out, and so today we’ll try to kill two birds with one stone - we’ll install a site search script from Google, which will improve the quality of what’s built into your CMS (content management system), and we’ll also set up the display of advertising blocks in its results AdSense that will help you earn extra income. Let's combine business with pleasure, so to speak.

Setting up and receiving search script code from Google

For example, I have long been thinking about using the search algorithm from Google or Yandex (), because the one built into WordPress did not suit me (and probably blog visitors too) both in terms of the quality and convenience of the results provided. I think that almost the same can be said about its analogues in Joomla and other popular engines ().

For my WordPress blog, I used the search box already included in the template, adapting it for Google. Its appearance remains the same, maximally corresponding to the design of the blog, but the search itself is now carried out using the algorithms of the most powerful search engine in the world, and Google AdSense advertising blocks are displayed in its results.

To do this, I had to cross a hedgehog with a snake, i.e. change the standard blog search script taking into account the code obtained from the materials of this article.

The script I received from Google for my blog looked like this:

The standard code, which was located in the searchform.php file in the folder with the WordPress theme I was using, looked like this:

By crossing a hedgehog with a snake, I got the following script, which is now in use:

I won’t go into the details of the changes made, because it will be very voluminous, and the article is already quite large. Therefore, I leave the code analysis to your discretion; I think that with a detailed comparison you will quickly understand everything.

I also recommend reading: How to earn more in contextual advertising Google Adsense http://sosnovskij.ru/google-adsense-secrety-uspeha/ - eight secrets of successful work with contextual advertising blocks.