This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** Ожидание загрузки счетчика Яндекс.Метрики | |
| * @param {?(number|string)} ymCounterNum - номер счетчика, если известен | |
| * @param {function} callback - получает аргументами объект и номер счетчика | |
| * @param {number} interval - интервал проверки готовности счетчика | |
| */ | |
| function waitForYm(ymCounterNum, callback, interval) { | |
| if (!callback) return; | |
| if (!ymCounterNum) { | |
| let metrikaObj = (window.Ya && (window.Ya.Metrika || window.Ya.Metrika2)) || null; | |
| ymCounterNum = (metrikaObj && metrikaObj.counters && (metrikaObj.counters() || [0])[0].id) || 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| (function (css_href) { | |
| "use strict"; | |
| // a simple event handler wrapper | |
| function on(el, ev, callback) { | |
| if (el.addEventListener) { | |
| el.addEventListener(ev, callback, false); | |
| } else if (el.attachEvent) { | |
| el.attachEvent("on" + ev, callback); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tress = require('tress'); | |
| var needle = require('needle'); | |
| var cheerio = require('cheerio'); | |
| var resolve = require('url').resolve; | |
| var fs = require('fs'); | |
| var URL = 'http://www.ferra.ru/ru/techlife/news/'; | |
| var results = []; | |
| var q = tress(function(url, callback){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| (function () { | |
| "use strict"; | |
| // once cached, the css file is stored on the client forever unless | |
| // the URL below is changed. Any change will invalidate the cache | |
| var css_href = './index_files/web-fonts.css'; | |
| // a simple event handler wrapper | |
| function on(el, ev, callback) { | |
| if (el.addEventListener) { | |
| el.addEventListener(ev, callback, false); |