This file contains 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
(function () { | |
window.debounce = function(callback, ms) { | |
var isCooldown = false; | |
return function() { | |
if (isCooldown) return; | |
callback.apply(this, arguments); |
This file contains 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
'use strict'; | |
(function () { | |
var filterState = { | |
'housing-type': 'any', | |
'housing-rooms': 'any', | |
'housing-guests': 'any', | |
'housing-price': 'any', | |
'features': [] | |
}; |
This file contains 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
'use strict'; | |
(function () { | |
// начальное состояние фильтров, можно сразу заполнить дефолтными значениями | |
var filterState = { | |
'housing-type': 'any', | |
'housing-rooms': 'any', | |
'housing-guests': 'any', | |
features: {} | |
} |
This file contains 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
'use strict'; | |
var OFFERS_AMOUNT = 8; | |
var houseTypes = ['palace', 'flat', 'house', 'bungalo']; | |
var localizedOfferType = { | |
'flat': 'Квартира', | |
'bungalo': 'Бунгало', | |
'house': 'Дом', |
This file contains 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 SOURCE_TAB_NAME = "Портфель"; | |
var TIKER_RANGE = "A8:B120"; | |
var MICEX_RATES_PAGE_NAME = "MicexRateTickers"; | |
var MICEX_INDEX_PAGE_NAME = "IMOEX"; | |
function onOpen() { | |
SpreadsheetApp.getUi() | |
.createMenu('MICEX Updater') | |
.addItem('Update Rates', 'updateRates') | |
.addItem('Update Index', 'updateMecixIndex') |
This file contains 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 CGI = {}; | |
CGI.buildQueryParams = function(params) { | |
var res = []; | |
for(var key in params) { | |
res.push(key + '=' + params[key]); | |
} | |
return res.length > 0 ? '?' + res.join('&') : ''; | |
}; |
This file contains 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
if (typeof Object.assign !== 'function') { | |
Object.defineProperty(Object, "assign", { | |
value: function assign(target, varArgs) { // .length of function is 2 | |
if (target === null || target === undefined) { | |
throw new TypeError('Cannot convert undefined or null to object'); | |
} | |
var to = Object(target); | |
for (var index = 1; index < arguments.length; index++) { |
This file contains 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 MicexApi = {}; | |
// список id разных типов ЦБ | |
var BOARD_ID = { | |
STOCK: 'TQBR', | |
ETF: 'TQTF', | |
BONDS: 'EQOB' | |
}; | |
(function(App) { | |
var MICEX_ENTRYPOINT = 'https://iss.moex.com/iss/'; |
This file contains 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 ENTRYPOINT = "https://www.statbureau.org/calculate-inflation-rate-json"; | |
/** | |
* Получаем инфлацию за произвольный период | |
* | |
* @param {string} country - страна (belarus, brazil, canada, european-union, eurozone, france, germany, greece, india, japan, kazakhstan, mexico, russia, spain, turkey, ukraine, united-kingdom, united-states) | |
* @param {Date} start - первый месяц, включительно | |
* @param {Date} end - последний месяц, включительно | |
* @return Получаем инфляцию за произвольный период | |
* @customfunction |
This file contains 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 CBR_ENTRYPOINT = "https://www.cbr.ru/scripts/XML_daily.asp"; | |
/** | |
* Получаем курс ЦБ на дату | |
* | |
* @param {string} currency - код валюты | |
* @param {Date} date - день | |
* @return {Number} | |
* @customfunction | |
*/ |