Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/filipemeneses/fatec-api
API for SIGA from Centro Paula Souza made for students to create things based in their profile data
https://github.com/filipemeneses/fatec-api
api fatec fatec-api profile-data scrapper siga
Last synced: 17 days ago
JSON representation
API for SIGA from Centro Paula Souza made for students to create things based in their profile data
- Host: GitHub
- URL: https://github.com/filipemeneses/fatec-api
- Owner: filipemeneses
- Created: 2017-12-14T20:21:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-27T21:10:44.000Z (about 1 year ago)
- Last Synced: 2024-10-11T10:31:38.275Z (about 1 month ago)
- Topics: api, fatec, fatec-api, profile-data, scrapper, siga
- Language: TypeScript
- Homepage: https://filipemeneses.gitbooks.io/fatec-api/
- Size: 241 KB
- Stars: 57
- Watchers: 1
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# fatec-api
[![Travis branch](https://img.shields.io/travis/filipemeneses/fatec-api/master.svg)]()
[![npm](https://img.shields.io/npm/v/fatec-api.svg)]()API for SIGA from Centro Paula Souza made for students to create scripts based in their profile data.
# Usage
Install the package:
```sh
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](https://nodejs.org/en/) using ES6 syntax.
```js
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()`:
![](https://cdn.rawgit.com/filipemeneses/fatec-api-doc/cf3a990f/assets/requests.svg)
Check out the [documentation](https://filipemeneses.gitbooks.io/fatec-api/) for more info.
# Documentation
Available at: https://filipemeneses.gitbooks.io/fatec-api/
# Discussion
Available at: https://discord.gg/RUv5Kxw
# Development
1. **Clone:**
```sh
git clone https://github.com/filipemeneses/fatec-api.git
cd fatec-api
```
2. **Install:**
```sh
npm i
```
3. **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
```sh
npm run test:api
```- `tests/Siga.test.ts` to test the integrity of SIGA (check if scrapped tags remains the same)
```sh
npm run test:siga
```To test all:
```sh
npm run test
```