1.5.0 • Published 5 years ago

fatec-api v1.5.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

fatec-api

Travis branch npm

API for SIGA from Centro Paula Souza made for students to create scripts based in their profile data.

Usage

Install the package:

npm install fatec-api --save

Check the documentation at: https://filipemeneses.gitbooks.io/fatec-api/

Getting Started

A quick example will show how to use it, scrapping the user name. And will cover the usage with Node.js using ES6 syntax.

const fatecApi = require('fatec-api')
const myAccount = new fatecApi.Account('LOGIN', 'PASSWORD')

myAccount.login().then(() => {
  return myAccount.getName().then(name => {
    console.log(name)
    // <- 'YOUR FULL NAME WITH CAPSLOCK'
  })
})

How it works

This library scrap data using HTTP requests with request and parses the HTML with cheerio library.

The auth/Account class does the heavy lifting, making the requests using core/Network. The scrapped data is later available at the attribute student of the auth/Account instance.

Here's the flow of account.getName():

npm.io

Check out the documentation for more info.

Documentation

Available at: https://filipemeneses.gitbooks.io/fatec-api/

Discussion

Available at: https://discord.gg/RUv5Kxw

Development

  1. Clone:
git clone https://github.com/filipemeneses/fatec-api.git
cd fatec-api
  1. Install:
npm i
  1. Test:

    Create the .env file in the root with the required values to test.

    LOGIN=TEST
    PASSWORD=TEST
    NAME=TEST

    There is two important test files to keep track with:

  • tests/FatecApi.test.ts to test the library features

    npm run test:api
  • tests/Siga.test.ts to test the integrity of SIGA (check if scrapped tags remains the same)

    npm run test:siga

    To test all:

    npm run test
1.5.0

5 years ago

1.4.0

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

8 years ago

0.9.0

8 years ago

0.7.2

8 years ago

0.7.0

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago