📜 ⬆️ ⬇️

Service that helps to find “rare” products on TaoBao (+ a bit of free Google Translate API)

Greetings to all! I think very, very many people know what TaoBao is or at least heard.

For those who do not know: TaoBao is a giant Chinese marketplace, the amount of goods on which is measured by a number close to a billion. There you can find almost any whim of your imagination, and quite cheap. But there are two problems: find a product (the entire TaoBao website and all descriptions in Chinese) and deliver it (delivery on TaoBao only in China)

If the second problem is easily solved by many intermediaries, then the first one is a bit more complicated. If you want to find something interesting, unusual or beyond the scope of "everyday goods", then you will face a difficulty in the form of a language barrier.
')
About two months ago, I tried to launch my online store, the range of which is quite unique for Russia. It was planned to purchase goods on TaoBao. The task of searching for goods and some ideas to simplify this tedious process were embodied in the idea of ​​a service assistant. Some routine actions could be automated, which was done. What came out of this look under the cut.

Screen service home page

Auxiliary "Widgets"




The main task of the service


Almost always I quickly find the copies of the goods I need. But the problem is that in the search results on two or three pages of results products that meet my search criteria 3-5. The rest are the result of inaccurate translation, and for me they are “search rubbish”. Let's look at a simple, but at the same time a real example. We need to find here a heating pad for hands on TaoBao image In the photo of the package we see the brand name “winfire” and a couple of hieroglyphs that for us, as people who do not know Chinese, it will be difficult to drive into the search results. Just want to clarify that the brand is not important to us. We need a hand warmer of the same type.
If we try to do a search with the translation for the request "hand warmer", we get not what we were looking for.

If we try to search the hot-water bottle for the query "winfire", we will find it, along with a bunch of various winter shoes in the search results .

The results for the “WinFire” query are already interesting for us. It is not difficult to assume that in the names of products that meet our criteria among the hieroglyphs lie our “keywords”. Identifying them manually is a very ungrateful business. This is the main task of the service.
All you need is to copy the names of products that meet our needs in the input fields and click the button “find keywords”

In order to demonstrate this feature, on the main page of TaoHelp.Me, you can click on the “Demonstration” link and the fields will be filled with the characters from the above example.

After clicking the button “find keywords” you will see the translation of each name into Russian, as well as the hieroglyphs common to 50% of the names. The button “Search by keys on TaoBao” will open the search results in accordance with the specified keys. As you can see, now in the search results we see exactly what we were looking for.

You may have noticed that the button “find keywords” has changed its name to “refine results”. Now its function is to find common hieroglyphs not for 50% of titles, but for as many of them as possible (that is, if common characters were 品 怀金怀 暖手 宝, then after pressing the button 怀 暖 became). Now the search results have changed, and we can already see not only the product that interests us, but also its other varieties with consumables.

It is worth mentioning the options Latin and Hieroglyphs. If you include Latin, then the keywords will also include words consisting of the Latin alphabet (in our case, the word winfire)

How is the translation


Probably everyone knows that Google has already closed access to the API of its translator for quite some time. This is true, but the ability to use some features for free exists thanks to the website translator . I suspect that almost certainly, if you use it from the server side, you can get an ip ban very quickly, but if you use it on JS, then this problem is solved very easily. Here is an example using jQuery
$.post( "http://translate.googleapis.com/translate_a/t?anno=3&client=te&format=json&v=1.0&logld=v10", { q: value, sl: "auto", tl: 'ru', tc: "1" }, function(data) {alert(data[0])}, "json" ); 

Here, the q parameter is the original string; sl is the source language; tl - final language

In conclusion, I want to say


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


All Articles