From 9517ff8ae97dd1d807b46b3063fd9e45a6ca852c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 19 Apr 2018 14:50:55 +0200 Subject: [PATCH] Cleaning Old Code --- .vs/AAWeb/v15/.suo | Bin 19968 -> 24064 bytes FileServer.js | 126 --------------------------------------------- 2 files changed, 126 deletions(-) diff --git a/.vs/AAWeb/v15/.suo b/.vs/AAWeb/v15/.suo index fbcc8de78183e339ab575808f2d4b600eaa6a2ce..78c8d24319c157b9d3c9e9061f2a10e7e002abc0 100644 GIT binary patch delta 2559 zcmd5;&2Jk;6rWjpHydZ|*mcu5&WG)kexz+8TS6cUlGyRaIJJq>1VSk(A0?J(6{&4% zr>Or5BK(2P%Ywizt<9-dpdwHs+9kDj4hM znfc9|nK$ptF1^i5pYYXiFSDAPF%OP8;!dSfA(}&6e(3zO%UlyO+zufj;5y;H@cXr^ z-*DPj>V%?H0i^h#h-B?--;kDNlrn?h!#W}f}YxrKoc@Ag3h3}t#0fy#}Jcy;6>Rd?=}g2 zRi5XX<3{vhB!&?qh*3lg5l4(65(pJBjz}UNL8K59i2V?9c%xYyO(6~-rV%rU#}JPr z4k4aEkp54a{ZrV_(HPd`x3rxpnUp7`>GAwgC@5LDB!zhfZYnE04F%_G+K{S{)9A^T zB;>bbolHc=awYB8%Ucujjo_PYfKf-)ZL`e zZ*_dhA<;Do!q%l~cD%y1ZEkS;K5R+}DElruIh8jmjg}Yna+hM4?&@ZSia(Ji&(_+S zIa1MW@4{^S3Vh!egkWEA!#Sq!O@1W6jZ_L^6D5f%@f@SX44R3F<#K@?X9YIThS)K7 z3I)h4Pm_>O`&Xe3!Ja+6)-^LM#}?U=@oils>Yq+TIX^`D3|N8*_8fbjy?}yMv7bM` zvMd&VdGE}d*MFVP9r>E!53Se1HXGEI}X2b-68xi z{qeP~gB9aV^pAl2Lyd|_L!XrogN~hCg6(KH_Jc`}oDIv=3P%3!yMtde|p1*y~i_jgg!JyCr(_%Fb z!&l(|oy>XY_y%Xh{R+n{X-ZE!a9f$BnJ#hoDIO@=fX9u9LWBchM^ITO#H~&kFcm^F z_u5$Oy`l1hL@ia8F)~wmFjG~98DWR9ss;T{#G0z>inr#VT|(p{)*&dCs#mf(S{ya=MF{#5JORV4yP>VM3WU;j z?R4oCAypo*jw5xXp~ygu+|+WaeEk3P?2|}ty}v9oq@__SPRyv8(P_}X(HW{z{y$^* zM|jE}mWgN@UJv@i5AkfAMCZq*O2)AvSumHGdNu7^W))5h(Yw&|uA*|Xa7Lg92P?&@ zlKBaYVra>ddBIE%hy!;yVaR1#PyZ98Jd6mjIv93u1fQpJS07vWoKBx&U96W?v2NCf z{$1E&b#|}A{SZQ5l!wC?&*n{Zy1e}C(x(rz>O|%3i3^gz*+B$ ze@SU&2`t@%r5WnntWA{$P}v%LnC)RZSq10wM`!6j!;i&?9|A4q?jv2tJKB1CI{Qx~L-F3us_wq6@vfb< zak>(NN6~ulL|oc(`%8g~U~_e(T83cCZQ|q$!F8VnZbX+Hq$^|d-4Ambo4!8@2j9Kf e`|aZe7;W)qLndJ)`V%wMA8dqtcLIE_qrU-0_j14h diff --git a/FileServer.js b/FileServer.js index e4a6a5a04..1e0fd37bc 100644 --- a/FileServer.js +++ b/FileServer.js @@ -15,14 +15,9 @@ function newFileServer() { var httpServer; // This is the object that allows as to make calls to the fileServer. var fileServer = { - getOrderBook: getOrderBook, - getAggregattedOrderBook: getAggregattedOrderBook, getMarkets: getMarkets, - getLastTrades: getLastTrades, - getTrades: getTrades, getMarketFilesCandles: getMarketFilesCandles, getMarketIndexVolumes: getMarketIndexVolumes, - getAllTimes: getAllTimes, getDailyFile: getDailyFile, initialize: initialize }; @@ -150,29 +145,6 @@ function newFileServer() { } - function getAllTimes(exchangeId, marketId, callBackFunction) { - - let fileName = exchangeId + "_" + marketId + ".json"; - - fileService.getFileToText('data', 'all-times', fileName, undefined, onFileReceived); - - function onFileReceived(err, text, response) { - - if (err) { - - let data = JSON.parse("[]"); - callBackFunction(data); - - } else { - - let data = JSON.parse(text); - callBackFunction(data); - - } - } - } - - function getDailyFile(exchangeId, marketId, date, callBackFunction) { let fileName = '' + 'USDT' + '_' + 'BTC' + '.json'; @@ -251,104 +223,6 @@ function newFileServer() { - function getAggregattedOrderBook(exchangeId, marketId, date, callBackFunction) { - - let stringDate = date.getFullYear() + '/' + pad(date.getMonth() + 1, 2) + '/' + pad(date.getDate(), 2) + '/' + pad(date.getHours(), 2) + '/' + pad(date.getMinutes(), 2); - - let fileName = stringDate + "/" + exchangeId + "_" + marketId + ".json"; - - fileService.getFileToText('data', 'aggregatted-order-books', fileName, undefined, onFileReceived); - - function onFileReceived(err, text, response) { - - if (err) { - - let data = JSON.parse("[]"); - callBackFunction(data); - - } else { - - let data = JSON.parse(text); - callBackFunction(data); - - } - } - - } - - - - function getOrderBook(exchangeId, marketId, date, callBackFunction) { - - let stringDate = date.getFullYear() + '/' + pad(date.getMonth() + 1, 2) + '/' + pad(date.getDate(), 2) + '/' + pad(date.getHours(), 2) + '/' + pad(date.getMinutes(), 2); - - let fileName = stringDate + "/" + exchangeId + "_" + marketId + ".json"; - - fileService.getFileToText('data', 'order-books', fileName, undefined, onFileReceived); - - function onFileReceived(err, text, response) { - - if (err) { - - let data = JSON.parse("[]"); - callBackFunction(data); - - } else { - - let data = JSON.parse(text); - callBackFunction(data); - - } - } - } - - - - - function getLastTrades(marketId, exchangeId, callBackFunction) { - - requestTrades(); - - function requestTrades() { - - httpServer = new XMLHttpRequest(); - httpServer.open('GET', "lastTrades/" + marketId + "/" + exchangeId, true); - httpServer.send(); - - httpServer.onreadystatechange = onHttpServerResponded; - - function onHttpServerResponded(err) { - - checkResponse(callBackFunction); - - } - } - - } - - - - function getTrades(idBegin, idEnd, marketId, exchangeId, callBackFunction) { - - requestTrades(); - - function requestTrades() { - - httpServer = new XMLHttpRequest(); - httpServer.open('GET', "trades/" + marketId + "/" + exchangeId + "/" + idBegin + "/" + idEnd, true); - httpServer.send(); - - httpServer.onreadystatechange = onHttpServerResponded; - - function onHttpServerResponded(err) { - - checkResponse(callBackFunction); - - } - } - } - - function checkResponse(callBackFunction) {