Giter VIP home page Giter VIP logo

librus-api's People

Contributors

delwing avatar dependabot[bot] avatar diaxmanpl avatar hubix9 avatar kamchy avatar koliwbr avatar mati365 avatar matisiekpl avatar mccartney avatar michaltcz avatar norbiros avatar swiergot avatar tom-311 avatar xxsource98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

librus-api's Issues

listHomeworks

W readme, w przykładzie mamy client.homework.listHomeworks
tymczasem w API jest listHomework (bez s na końcu).

PS super kod pozdrawiam

listReceivers throws StatusCodeError: 500

Po invokowaniu
client.authorize('*******', '*******').then( client.inbox.listReceivers("nauczyciel").then(data => {console.log(data)}) )
otrzymuje
Unhandled rejection StatusCodeError: 500 - "" at new StatusCodeError (C:\Users\nate2463\Desktop\nwd-rel-zwln\node_modules\request-promise-core\lib\errors.js:32:15) at Request.plumbing.callback (C:\Users\nate2463\Desktop\nwd-rel-zwln\node_modules\request-promise-core\lib\plumbing.js:104:33) at Request.RP$callback [as _callback] (C:\Users\nate2463\Desktop\nwd-rel-zwln\node_modules\request-promise-core\lib\plumbing.js:46:31) at Request.self.callback (C:\Users\nate2463\Desktop\nwd-rel-zwln\node_modules\request\request.js:185:22) at Request.emit (events.js:210:5) at Request.EventEmitter.emit (domain.js:498:23) at Request.<anonymous> (C:\Users\nate2463\Desktop\nwd-rel-zwln\node_modules\request\request.js:1161:10) at Request.emit (events.js:210:5) at Request.EventEmitter.emit (domain.js:498:23) at IncomingMessage.<anonymous> (C:\Users\nate2463\Desktop\nwd-rel-zwln\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:299:28) at IncomingMessage.emit (events.js:215:7) at IncomingMessage.EventEmitter.emit (domain.js:498:23) at endReadableNT (_stream_readable.js:1184:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)
Wszystko inne działa

Content is undefined

Hi, today I wanted to read message content, but the API returning undefined
My code:

client.inbox.listInbox(5).then(data => {
        const latestMessage = data[0]
        client.inbox.getMessage(5, latestMessage.id).then(data => console.log(data));
        console.log(latestMessage.content)
}

Axios errror / zmiana headerów

Podczas próby połączenia z librusem, wyskakują same błedy na temat axiosa.

Aktualny kod

  const Librus = require("librus-api");
    let client = new Librus();
    client.authorize(name, password).then(() => {
        console.log("Logged in");
    }).catch((err: any) => {
        console.error(err);
    });

Błąd

(Login in daje siępoprzez kod, ale nie wiem czemu bo nie chce się zalogować defacto)
image

Unhandled rejection StatusCodeError: 403

Cześć!
Co trzeba zrobić poza zainstalowaniem node.js i npm install librus-api? Potrzebne jest coś jeszcze?
By w konsoli uzyskać np. szczęśliwy numerek utworzyłem taki skrypt:
'use strict'; const Librus = require("librus-api"); let client = new Librus(); client.authorize("mojlogin", "haslo").then(function () { console.log(client.info.getLuckyNumber().then(data => {})); });

I wyświetla zamiast tej liczby masę tekstu:

Unhandled rejection StatusCodeError: 403 - "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
...
</body>\r\n    </html>\r\n  "
    at new StatusCodeError (C:\Users\Tomek\node_modules\request-promise-core\lib\errors.js:32:15)
    at Request.plumbing.callback (C:\Users\Tomek\node_modules\request-promise-core\lib\plumbing.js:104:33)
    at Request.RP$callback [as _callback] (C:\Users\Tomek\node_modules\request-promise-core\lib\plumbing.js:46:31)
    at Request.self.callback (C:\Users\Tomek\node_modules\request\request.js:185:22)
    at Request.emit (events.js:400:28)
    at Request.<anonymous> (C:\Users\Tomek\node_modules\request\request.js:1154:10)
    at Request.emit (events.js:400:28)
    at Gunzip.<anonymous> (C:\Users\Tomek\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (events.js:519:28)
    at Gunzip.emit (events.js:400:28)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections `(internal/process/task_queues.js:82:21)`

Te wyniki mają być jakoś przekierowane na stronę www z konsoli? Totalnie nie znam się na js ani na node.

Errors instantly after executing file

Hi, i executed file (usage.js) with command node usege.js and those are the things which were shown to me.
How to check if i am really connected, logged in and i am in librus panel? How can i retrieve entire body from there?

/.../Librus-Frequency/librus_api/node_modules/axios/dist/node/axios.cjs:836
  AxiosError.call(axiosError, error.message, code, config, request, response);
             ^
AxiosError: connect ECONNREFUSED ::1:80
    at AxiosError.from (/.../Librus-Frequency/librus_api/node_modules/axios/dist/node/axios.cjs:836:14)
    at RedirectableRequest.handleRequestError (/.../Developer/Librus-Frequency/librus_api/node_modules/axios/dist/node/axios.cjs:3010:25)
    at RedirectableRequest.emit (node:events:513:28)
    at eventHandlers.<computed> (/.../Librus-Frequency/librus_api/node_modules/follow-redirects/index.js:14:24)
    at ClientRequest.emit (node:events:513:28)
    at req.emit (/.../Librus-Frequency/librus_api/node_modules/http-cookie-agent/dist/http/create_cookie_agent.js:84:16)
    at Socket.socketErrorListener (node:_http_client:494:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)

Thank you very much for sharing this api <3

Node-Red

Cześć. Jest szansa zrobić z tego moduł do Node-Red?

Nie działa logowanie

Po zmianach tego lata - logowanie do Librusa przestało działać.

Poprawiłem w swoim forku:
mccartney@732d73f
(niezbyt elegancko, bo hardcode'ując URLe)

Ale może komuś się przyda...

TypeScript

Przydały by się definicje typów do TypeScript. Jeśli jest potrzeba mogę sam zrobić i dać PR :)

Error in version 2.8.0

/home/norbi/Development/RadioBON/RadioBON-API/node_modules/librus-api/lib/tools.js:15
cheerio.prototype.trim = function() {
                       ^

TypeError: Cannot set properties of undefined (setting 'trim')
    at Object.<anonymous> (/home/norbi/Development/RadioBON/RadioBON-API/node_modules/librus-api/lib/tools.js:15:24)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
    at Module.load (node:internal/modules/cjs/loader:998:32)
    at Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1022:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/norbi/Development/RadioBON/RadioBON-API/node_modules/librus-api/lib/resources/inbox.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
    at Module.load (node:internal/modules/cjs/loader:998:32)
    at Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1022:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at /home/norbi/Development/RadioBON/RadioBON-API/node_modules/librus-api/lib/api.js:86:20
    at arrayEach (/home/norbi/Development/RadioBON/RadioBON-API/node_modules/lodash/lodash.js:530:11)
    at Function.forEach (/home/norbi/Development/RadioBON/RadioBON-API/node_modules/lodash/lodash.js:9410:14)
    at Librus._loadModules (/home/norbi/Development/RadioBON/RadioBON-API/node_modules/librus-api/lib/api.js:85:7)
    at new Librus (/home/norbi/Development/RadioBON/RadioBON-API/node_modules/librus-api/lib/api.js:32:10)
    at fetchLibrusData (/home/norbi/Development/RadioBON/RadioBON-API/utils.js:6:11)
    at Object.<anonymous> (/home/norbi/Development/RadioBON/RadioBON-API/utils.js:14:1)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)

Node.js v18.6.0
[nodemon] app crashed - waiting for file changes before starting...

Node: v18.6.0

getMessage nie zwawiera `files`

getMessage() bezproblemowo podaje tytuł, treść czy inne pierdoły ale nie ma pola file które pozwalało by na pobranie plików

listInbox

Nie mam pojecia jak ma dzialac to api, probuje recznie robic requesty do librusa ale nie dostaje nic w odpowiedzi
natomiast tutaj listInbox(5) zwraca bardzo malo wiadomosci, da sie jakos zrobic zeby zwracal wszystkie?

nie ważne? zachowanie sie zmienia z czasem, raz zwraca niepelna liste raz pelna

ERR_BAD_REQUEST on getting timetable

Hello,

I tried to use client.calendar.getTimetable() and got a 404 AxiosError.

Code:

"use strict";

const Librus = require('librus-api');
const client = new Librus();

client.authorize('<login>', '<password>').then(function () 
{
    client.calendar.getTimetable().then((data) => {console.log(data)});
});

Error:

C:\Users\jozek\Developer\librus\node_modules\axios\dist\node\axios.cjs:1913
    reject(new AxiosError(
           ^
AxiosError: Request failed with status code 404
...

The response also has this html content (part of it):

'  <h3>Błąd HTTP 404.0 — Not Found</h3> \n' +
'  <h4>Zasób, do którego chcesz uzyskać dostęp, został usunięty, jego nazwa uległa zmianie lub jest okresowo niedostępny.</h4> \n' +

I don't know if this is a Librus configuration issue by my school administrator or a librus-api bug...? Please let me know!

Błąd w getNotifications()

Api z niewiadomych przyczyn nie jest w stanie odczytać poprawnie powiadomień. Mnie na librusie pokazuje, że mam 3 powiadomienia, a api pokazuje 1. Próbowałem to naprawić, lecz nie umiem.

Oceny II Semestr

Możliwość pobierania ocen z II semestru, funkcja pobiera tylko I semestr

Question

Is there any option for getting account name? For example I have account with login 138372972892782, but my name is DiaxManPl.

Problem z Ocenami

Gdzie jest problem?

Przy poproszeniu o wszystkie oceny, zwracane jest "kurwa nic"

Wynik Programu


Kod

const Librus = require("librus-api");
require('dotenv').config()
const env = process.env

let client = new Librus();
client.authorize(process.env.LIBRUS_LOGIN, process.env.LIBRUS_PASSWD).then(function () {
    client.info.getGrades().then(data => console.log(data));
})

Dodatkowe Informacje

Potrzebuje szybko tych danych, żebym mógł ich używać w integracji 🥶
Szybka odpowiedz będzie mile widziana oraz doceniona ⭐

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.