Skip to content

Commit

Permalink
Merge pull request #3 from mikhaillav/dev
Browse files Browse the repository at this point in the history
1.2.2
  • Loading branch information
mikhaillav authored Mar 29, 2023
2 parents 74bd383 + 6cd853c commit 111c78c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions glolime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/
*
Expand Down

0 comments on commit 111c78c

Please sign in to comment.