3.0.7 • Published 1 year ago

argoscuolanext v3.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ArgoScuolaNext-NodeJS ALTERNATIVE

npm version npm downloads

A NodeJS library that uses Puppeteer to interact with ArgoScuolaNext.
This is not designed for production use it is primarily intended for testing and learning purposes.

A better alternative to this library

I have recently found a better alternative to this library, it is called portaleargo-api. It is based on the actual API used by the app and it is much faster and easier to use.
This repository will be archived and I will not continue to develop it.

Installation

npm i argoscuolanext
(pnpm add / yarn add) 

Importing the package:

import Session from "argoscuolanext";

Usage

Warning:

This is an async library so you need to use await/async or Promise.
For this reason you need to use an async function.
My tip is to use an IIFE. Example :

(async () => {
	...
})();

In this example I have also used an Arrow Function () => {} this doesn't have any great difference from a normal function function() {}

Login

// Create the session
const argoscuolanext = require('./ArgoScuolaNext-NodeJS').default;
const session = new Argo('school code', 'user name', 'password', true); // Creates a new Session instance with debug true

// Use the async function
(async () => {
  // Login using the function
  if (await session.login()) {
    ...
  }
  
  ...
})();

Requests

The informations can be obtained by calling the method of each 'endpoint'

...

(async () => {
  
  if (await session.login()) {
    // The methods
    console.log(await session.voti());
    console.log(await session.argomenti());
    console.log(await session.assenze());
    console.log(await session.compiti());
    console.log(await session.docenti());
    console.log(await session.note());
  }

  ...
})();

Debug

If the debug flag is enabled the library will start printing in console the actions it is doing.
You can pass a callback using the debugCallback function or add/change it via the setDebugCallback function, it will be executed with the print in console and with the same string as a parameter.

Limits

You can limit the amount of elements that will be returned by every functions passing a number as parameter.

Contributing

Any suggestion is accepted! Please if you want to contribute, fork this repo and merge when you have done the modification.

Disclaimer

This is for EDUCATIONAL AND EVALUATION PURPOSES ONLY.
No responsibility is held or accepted for misuse.

3.0.7

1 year ago

3.0.6

1 year ago

3.0.4

1 year ago

3.0.5

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago

0.9.1

2 years ago

0.9.0

2 years ago

0.1.0

2 years ago