2.0.1 • Published 5 years ago

@bratanstudio/tneu_rank v2.0.1

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
5 years ago

bratanstudio


Table of contents

  • Features
  • Installing
  • Example
  • Request params
  • Response types
  • License

Features

  • getting all data about your study process
  • what else do you need for happiness?

Installing

You can use both yarn or npm for installing. We ❤️ yarn.

yarn add @bratanstudio/tneu_rank

Wanna test it?

cd node_modules/@bratanstudio/tneu_rank && yarn test

Example

With ES8 syntax.

import Rank from '@bratanstudio/tneu_rank'

(async () => {
	const params = {}
	const body = new Rank(params)
	const json = await body.parse()
	console.log(json)
})()

Or with old ES5.

const Rank = require('@bratanstudio/tneu_rank')

const params = {}
const body = new Rank(params)
body.parse().then((json) => {
	console.log(json)
})

Request params

Original TNEU Rank website is mod.tanet.edu.te.ua. All requests are linked to this site.

namedescriptiondefault
postOriginal website login pagehttp://mod.tanet.edu.te.ua/site/login
getOriginal website scores pagehttp://mod.tanet.edu.te.ua/ratings/index
usernameYour login
passwordYour password

We don't store your data anywhere!

Response types

namedescriptionresponseerror code
login errorWhen tryna login with no login data or data is incorrect you'll get that erroran error has occurred while try to login. please, check login data1
empty errorWhen there's no data for any semesterThe results is empty yet..2
wtf errorNo one knows wtf it means...Something went wrong...3
all goodAll stuff works like a charmfalse

If you do all things the right way then you'll get the following response with all info:

fielddescription
pibfull name of user
itemslist of subjects (2 arrays, because there are two semesters in one year)
items.namename of the subject
items.controlcontrol type (exam, etc.)
items.examslist of all modules for the subject
exams.percentageweight of the module in percents
exams.datedeadline for the module
exams.scorescore for the module
exams.totaltotal score for the subject

Example output

{
       "pib": "ЛЯЩИНСЬКИЙ Петро Борисович (КІм-11)",
       "items": 
            [
                [ 
                    {
                        "name": "Дослідження мережевих операційних систем",
                        "control": "Екзамен",
                        "exams": 
                            [
                                {
                                    "percentage": "20",
                                    "date": "28.10.18",
                                    "score": "90"
                                },
                                {
                                    "percentage": "20",
                                    "date": "23.11.18",
                                    "score": "95"
                                },
                                {
                                    "percentage": "20",
                                    "date": "06.12.18",
                                    "score": "95"
                                },
                                {
                                    "percentage": "40",
                                    "date": "12.12.18",
                                    "score": "95"
                                },
                                {
                                    "total": "94"
                                }
                            ]
                    }
                ],
                [ 
                    {
                        "message": "The results is empty yet..",
                        "error": 2
                    }
                ]
            ],
       "error": false,
       "api": {
          "name": "mod.tanet Parser API",
          "ver": "2.0.1 🐋",
          "dev": {
             "name": "Petro Liashchynskyi",
             "github": "liashchynskyi",
             "org": "bratanstudio | BroStudioUA"
          },
          "prod": {
             "link": "http://rank.ml"
          }
       }
    }

License

© The code is under Apache 2.0 license. For more info, see LICENSE file.