📜 ⬆️ ⬇️

Yandex for developer

As everyone knows, Yandex and Google have services with similar functionality. And I think that this is very good: the competition makes both competitors move forward, and this translates into many pleasant bonuses for ordinary users. (If you do not remember about such doubtful cases as the purchase of Smilinka by Yandex)

But it seems to me that the management or developers of Yandex have a rather strange attitude towards third-party developers. I will give only two examples that I encountered, and I hope that, perhaps, thanks to this post, the situation will change for the better.


Search site


Once I needed to install a search on the site. It turned out that Google does not index our site very well, and I wanted to put a Yandex form. When I saw the code, I got scared.
< style type ="text/css" > div.b-yandexbox * { font-size: 12px !important; margin: 0 !important; } div.b-yandexbox a img { border: 0 !important; } div.b-yandexbox input, div.b-yandexbox label { vertical-align: middle; } div.b-yandexbox table { font-size: 12px; width: 100%; border-collapse: collapse; border: 0; background: #96a8c8; } div.b-yandexbox table td { padding: 7px 0 6px 0; white-space: nowrap; vertical-align: middle; } div.b-yandexbox .b-yandexbox-image { padding: 6px 6px 0 6px; } div.b-yandexbox .b-yandexbox-search { width: 100%; padding: 0 6px; } div.b-yandexbox .b-yandexbox-search table { margin: 0; padding: 0; background: none; } div.b-yandexbox .b-yandexbox-search .b-yandexbox-txt { width: 100%; padding-right: 6px; } div.b-yandexbox .b-yandexbox-text { position: relative; width: 100%; } div.b-yandexbox .b-yandexbox-text input { float: left; width: 100%; padding-right: 0; border: 1px solid #7f9db9; } div.b-yandexbox .b-yandexbox-search .b-yandexbox-submit { padding: 0; } div.b-yandexbox .b-hint-input { position: absolute; z-index: 100; left: 0; display: none; width: 30px; height: 11px; margin: 0.16em 0.2em !important; cursor: text; line-height: 0; background: url(http://site.yandex.ru/i/ysearch_small.png) no-repeat; } div.b-yandexbox .button-search { width: 19px; height: 15px; outline: none; cursor: pointer; border: none; background: url(http://site.yandex.ru/i/search.png) no-repeat; } </ style ><! -- [ if lte IE 8 ] >< style type ="text/css" > *:first-child+html div.b-yandexbox .b-hint-input { position: absolute; margin-top: 4px !important; } * html div.b-yandexbox .b-hint-input { position: relative; bottom: -0.5em; left: 0.3em; float: left; display: block; margin: 0 0 -1em !important; } </ style ><! [endif]-- >< script type ="text/javascript" > /*<![CDATA[*/ ( function (Lego){ if (!Lego) Lego = window.Lego = {}; Lego.clean = function (a) { var p = a.previousSibling; if (p) { a.onblur = function () { if (!a.value) { p.style.top = "" ; } }; p.style.top = "-9999px" ; } }; Lego.cleanIfNotEmpty = function (id) { var e = document .getElementById(id); e.previousSibling.style.display = "block" ; var f = function () { if (e.value) { Lego.clean(e); } }; setInterval(f, 100); }; })(window.Lego); /*]]>*/ </ script >
<div class = "b-yandexbox" ><form method= "get" action= "http://dev.xxxx.ru/search" ><table><tr><td class = "b-yandexbox-search" ><table><tr><td class = "b-yandexbox-txt" ><div class = "b-yandexbox-text" ><label for = "yandexbox-text" class = "b-hint-input" onfocus= "Lego.clean(this)" title= "" ></label><input name= "text" id= "yandexbox-text" onfocus= "Lego.clean(this)" /></div><script type= "text/javascript" >Lego.cleanIfNotEmpty( "yandexbox-text" ) </ script ></ td >< td class ="b-yandexbox-submit" >< input type ="hidden" name ="searchid" value ="128506" />< input type ="submit" value ="" /></ td ></ tr ></ table ></ td ></ tr ></ table ></ form ></ div >


* This source code was highlighted with Source Code Highlighter .
< style type ="text/css" > div.b-yandexbox * { font-size: 12px !important; margin: 0 !important; } div.b-yandexbox a img { border: 0 !important; } div.b-yandexbox input, div.b-yandexbox label { vertical-align: middle; } div.b-yandexbox table { font-size: 12px; width: 100%; border-collapse: collapse; border: 0; background: #96a8c8; } div.b-yandexbox table td { padding: 7px 0 6px 0; white-space: nowrap; vertical-align: middle; } div.b-yandexbox .b-yandexbox-image { padding: 6px 6px 0 6px; } div.b-yandexbox .b-yandexbox-search { width: 100%; padding: 0 6px; } div.b-yandexbox .b-yandexbox-search table { margin: 0; padding: 0; background: none; } div.b-yandexbox .b-yandexbox-search .b-yandexbox-txt { width: 100%; padding-right: 6px; } div.b-yandexbox .b-yandexbox-text { position: relative; width: 100%; } div.b-yandexbox .b-yandexbox-text input { float: left; width: 100%; padding-right: 0; border: 1px solid #7f9db9; } div.b-yandexbox .b-yandexbox-search .b-yandexbox-submit { padding: 0; } div.b-yandexbox .b-hint-input { position: absolute; z-index: 100; left: 0; display: none; width: 30px; height: 11px; margin: 0.16em 0.2em !important; cursor: text; line-height: 0; background: url(http://site.yandex.ru/i/ysearch_small.png) no-repeat; } div.b-yandexbox .button-search { width: 19px; height: 15px; outline: none; cursor: pointer; border: none; background: url(http://site.yandex.ru/i/search.png) no-repeat; } </ style ><! -- [ if lte IE 8 ] >< style type ="text/css" > *:first-child+html div.b-yandexbox .b-hint-input { position: absolute; margin-top: 4px !important; } * html div.b-yandexbox .b-hint-input { position: relative; bottom: -0.5em; left: 0.3em; float: left; display: block; margin: 0 0 -1em !important; } </ style ><! [endif]-- >< script type ="text/javascript" > /*<![CDATA[*/ ( function (Lego){ if (!Lego) Lego = window.Lego = {}; Lego.clean = function (a) { var p = a.previousSibling; if (p) { a.onblur = function () { if (!a.value) { p.style.top = "" ; } }; p.style.top = "-9999px" ; } }; Lego.cleanIfNotEmpty = function (id) { var e = document .getElementById(id); e.previousSibling.style.display = "block" ; var f = function () { if (e.value) { Lego.clean(e); } }; setInterval(f, 100); }; })(window.Lego); /*]]>*/ </ script >
<div class = "b-yandexbox" ><form method= "get" action= "http://dev.xxxx.ru/search" ><table><tr><td class = "b-yandexbox-search" ><table><tr><td class = "b-yandexbox-txt" ><div class = "b-yandexbox-text" ><label for = "yandexbox-text" class = "b-hint-input" onfocus= "Lego.clean(this)" title= "" ></label><input name= "text" id= "yandexbox-text" onfocus= "Lego.clean(this)" /></div><script type= "text/javascript" >Lego.cleanIfNotEmpty( "yandexbox-text" ) </ script ></ td >< td class ="b-yandexbox-submit" >< input type ="hidden" name ="searchid" value ="128506" />< input type ="submit" value ="" /></ td ></ tr ></ table ></ td ></ tr ></ table ></ form ></ div >


* This source code was highlighted with Source Code Highlighter .

Do not worry, I thought. He began to carefully remove the terrible jumble of code, styles and javascript, replace the labels with divs. But, as it turned out later, clause 4 of the user agreement explicitly prohibits changing the search form code received on the Service .
')
What does Google offer us?

< form action ="http://www.google.com/cse" id ="cse-search-box" >
< div >
< input type ="hidden" name ="cx" value ="000576298720900936897:0dw8trymppo" />
< input type ="hidden" name ="ie" value ="UTF-8" />
< input type ="text" name ="q" size ="31" />
< input type ="submit" name ="sa" value ="" />
</ div >
</ form >
< script type ="text/javascript" src ="http://www.google.com/cse/brand?form=cse-search-box&lang=ru" ></ script >

* This source code was highlighted with Source Code Highlighter .
< form action ="http://www.google.com/cse" id ="cse-search-box" >
< div >
< input type ="hidden" name ="cx" value ="000576298720900936897:0dw8trymppo" />
< input type ="hidden" name ="ie" value ="UTF-8" />
< input type ="text" name ="q" size ="31" />
< input type ="submit" name ="sa" value ="" />
</ div >
</ form >
< script type ="text/javascript" src ="http://www.google.com/cse/brand?form=cse-search-box&lang=ru" ></ script >

* This source code was highlighted with Source Code Highlighter .


Everything is simple and clean. There are no restrictions on change (you only need to save the Google logo). (However, I don’t even want to change this code).

Photos


I consider Yandex photos as the best photo hosting. Seriously. They have no weird taboos like on Flickr; convenient and fast interface, unlike Picasa Web.

An acquaintance approached me and said that he wanted to make a photo archive for a group of friends. With such interesting features as searching for people and places, a time chart and other unusual things. In my opinion, a great idea to do this on the basis of photo hosting: these photos will enrich the resource and will be available in specific applications.

Probably everyone has seen what awesome apps Flickr allows. And I began to study the Yandex Yandex Photos API for how to do all this. Of course, all information can be encoded into tags, even if there are no additional fields for the data (I confess, I don’t know if they are in Flickr). But it turned out that the API does not allow access to photo tags. Totally.

Instead of conclusion



Yandex, for some unknown reason, restricts access to the most elementary things, as if they are terribly afraid of something. No need to fear a third-party developer: see how many third-party projects use Google technology; and Google, in turn, quietly gets its advertising and self-promotion.


Be open , and the developers themselves will reach out to you, bringing new users and fame.

PS I wrote this topic not to blacken Yandex, but to listen and be a little better.

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


All Articles