Git Product home page Git Product logo

fatec-api's Introduction

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():

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

fatec-api's People

Contributors

dependabot[bot] avatar efraim-andrade avatar filipemeneses avatar jhsmaciel-sudo 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

Watchers

 avatar

fatec-api's Issues

Scrap exchange programs

Create a method to Account: .getExchangePrograms() to scrap the data from /aluno/intercambio.aspx.

If had an recent scrap, return it. If not, scrap again.

Scrap partial grades

Create a method to Account: .getPartialGrades() to scrap the data from /aluno/notasparciais.aspx.

If had an recent scrap, return it. If not, scrap again.

Scrap schedules

Create a method to Account: .getSchedules() to scrap the data from /aluno/horario.aspx.

If had an recent scrap, return it. If not, scrap again.

Scrap enrolled subjects

Create a method to Account: .getEnrolledDisciplines() to scrap data from:

image

available at /aluno/horario.aspx.

If had an recent scrap, return it. If not, scrap again.

Scrap discipline details

Create a method to Account: .getDisciplineDetails() to scrap the data from /aluno/planoensino.aspx.

Scrap academic calendar

Create a method to Account: .getAcademicCalendar() to scrap the data from /aluno/alu_alunocalendario.aspx.

If had an recent scrap, return it. If not, scrap again.

Scrap complete history

Create a method toAccount: .getHistory() to scrap data from /aluno/historicocompleto.aspx

Informações da matérias não estão sendo recuperados

Ao realizar testes com a API no momento de recuperar algumas informações das matérias, elas não são recuperadas. Tentei usar métodos diferentes que recuperar informações de matéria, no caso testei o getSchedules() e getAcademicCalendar(), e nestes dois casos o nome das matérias não retorna, talvez haja alguma mudança no site, porque os métodos recuperam a sigla normal.

Mesmo que eu tenha feito o teste apenas para recuperar o nome segue um print do retorno do getSchedules()

http://prntscr.com/i657kd

Scrap exams calendar

Create a method to Account: .getExamsCalendar() to scrap the data from /aluno/calendarioprovas.aspx.

If had an recent scrap, return it. If not, scrap again.

Scrap school grade

Create a method to Account: .getSchoolGrade() to scrap the data from /aluno/historicograde.aspx.

If had an recent scrap, return it. If not, scrap again.

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.