From d9ae664b05018a14b63e84ba95fd24c4d91a0873 Mon Sep 17 00:00:00 2001 From: mikhaillav Date: Wed, 29 Mar 2023 21:22:02 +0300 Subject: [PATCH 1/2] 1.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1394e0c..0fb975e 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ }, "module": "commonjs", "name": "spb_dnevnik", - "version": "1.1.3", + "version": "1.2.0", "description": "Client of dnevnik2.petersburgedu.ru, written on JS", "main": "index.js", "author": "mikhaillav", From a89b0e66ada7d0f9b8f1d5ca3f31dab5f2c9e5cf Mon Sep 17 00:00:00 2001 From: mikhaillav Date: Wed, 29 Mar 2023 22:26:25 +0300 Subject: [PATCH 2/2] add getNumberID_frameData --- glolime/index.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/glolime/index.js b/glolime/index.js index b4ecc34..3e465cd 100644 --- a/glolime/index.js +++ b/glolime/index.js @@ -10,6 +10,29 @@ const iconv = require('iconv-lite'); class glolime { + /** + * Запрос на school.glolime.ru/acquiring/searchbypaymentnumber/acquier/ + * + * Возвращает ссылку на оплату + * @param {Number} type 1 - горячее, 2 - буфет + * @param {Number} usernumber + */ + getNumberID_frameData(frameData){ + return axios.get(`https://school.glolime.ru/api/netrika/userinfo/?${frameData}`,{ responseType: 'arraybuffer' }) + .then(response => { + data = iconv.decode(response.data, 'windows-1251'); + + const balance = cheerio.load(data); + let str = balance('.document-list').find(balance('td'))[0].children[0].data + + return str + }) + .catch(error => { + console.log(error) + throw "Something went wrong by getting school.glolime.ru/api/netrika/transfer/create/"; + }); + } + /** * Запрос на school.glolime.ru/acquiring/searchbypaymentnumber/acquier/ *