1.0.2 • Published 7 years ago

@fcitdev/json v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

es babel jest lint


tanetjson-es6

Simple JSON Parser for TNEU Rating System. Used by Modern TNEU Rank (knowns as rank.ml). This version is written by ES6. The old version you can find here.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Installing

You can install this package via npm:

npm install @fcitdev/json

or via yarn:

yard add @fcitdev/json

Installing for contributing

For do experiments you need to clone the repo:

$ git clone https://github.com/fcitdev/tanetjson-es6

Install dependencies:

$ cd tanetjson-es6 && npm install

Test it:

$ npm run test

Example script

The next source file shows you simple usage of the package.

Simple source file

import {init, authenticate, parse} from '@fcitdev/json';

init({
  post: 'http://mod.tanet.edu.te.ua/site/login',
  get: 'http://mod.tanet.edu.te.ua/ratings/index',
  username: 'fakepassword',
  password: 'fakelogin'
});

(async () => {
  const body = await authenticate();
  const json = await parse(body);
  console.log(json);
})()

Output will be similar to this:

{
	"owner": "YOUR FULLNAME",
	"semester": [
		"Перший семестр",
		"Другий семестр"
	],
	"items": [
		{
		 //...//Subjects for 1st semester with all scores
		},
		{
		//...//Subjects for 2nd semester with all scores
		}
	]
}

License

MIT © Petro Liashchynskyi