npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mashovapi-js

v1.0.6

Published

A Mashov JS API wrapper

Downloads

2

Readme

What is Mashov API JS?

This is a nodeJS wrapper for the Mashov System

Contents

Installation:

npm i MashovAPI

It's that easy! NPM automatically installs required modules such as request.

You can get npm here if you don't have it installed.

Examples:

const MashovAPI = require("mashovapi-js");

var semel = "";
(async function(){
	var allSchools = await MashovAPI.getSchools();

	for(var i = 0; i < allSchools.length; i++){
	  if(allSchools[i].name == "/*School Name*/"){
	    semel = allSchools[i].semel;
	  }
	}
})();
const MashovAPI = require("mashovapi-js");

(async function(){
	await MashovAPI.loginWithCreds({username:"/*username*/",password:"/*password",year:2021,school:semel})

//Get the semel, which is the school ID by using the function refrenced above
})();
const MashovAPI = require("mashovapi-js");

(async function(){
	 let grades = await MashovAPI.getGrades();
	 let average = 0;
	 for(var i = 0; i < grades.length; i++){
	   average+=grades[i].grade;
	 }
	 average = average/grades.length;
	 console.log("Your average is: " + average);
})();

API

Mashov-API JS is an asynchronous library, which means it needs to be run in an async function with await statements.

MashovAPI.getGrades()

Returns array of JSON objects:

  {
    studentGuid: string,
    gradingEventId: int,
    grade: int,
    rangeGrade: string,
    rate: int,
    timestamp: string,
    teacherName: string,
    groupId: int,
    groupName: string,
    subjectName:string,
    eventDate:string,
    id: int,
    gradingPeriod: int,
    gradingEvent: string,
    gradeRate: int,
    gradeTypeId: int,
    gradeType:string
  }

MashovAPI.getPhoto()

Returns a url of type string with photo of user.

MashovAPI.getSchools() Can be used without user auth

Returns array of JSON objects:

  {
    semel: int,
    name: string,
    years: int array
  }

For behavior in class: MashovAPI.getBehave() For behavior out of class: MashovAPI.getOutBehave()

Returns array of JSON objects:

  {
    studentGuid: string,
    eventCode: int,
    justified: int (1 or -1),
    lessonId: int,
    reporterGuid: string,
    timestamp: string,
    groupId: int,
    lessonType: int,
    lesson: int,
    lessonDate: string,
    lessonReporter: string,
    achvaCode: int,
    achvaName: string,
    achvaAval: int,
    justificationId: int,
    justification: string,
    reporter:string,
    subject: string
  }

MashovAPI.getBirthday()

Returns a date string

MashovAPI.getHomework()

Returns array of JSON objects:

  {
    lessonId: int,
    lessonDate: string,
    homework:string,
    groupId: int,
    subjectName: string
  }

MashovAPI.getGrades()

Returns array of JSON objects:

  {
    fileId: string,
    studentGuid: string,
    labelId: int,
    labelName: string,
    displayOrder: int
  }

MashovAPI.getCardLinks()

Returns a link string

MashovAPI.getTimetable()

Returns array of JSON objects:

  {
    timeTable: { groupId: int, day: int (1-7), lesson: int, roomNum: string, weeks: int },
    groupDetails: {
      groupId: int,
      groupName: string,
      subjectName: string,
      groupTeachers: array,
      groupInactiveTeachers: array
    }
  }

MashovAPI.getMail()

Returns array of JSON objects:

  {
    conversationId: string,
    subject: string,
    sendTime: string,
    isNew: boolean,
    hasDrafts: boolean,
    hasAttachments: boolean,
    messages:array of message objects,
    labels: array,
    preventReply: boolean
  }

MashovAPI.getRecipients()

Returns array of JSON objects:

  {
    displayOrder: int,
    value: string,
    valueType: string,
    targetType: string,
    displayName: string
  }

Plans

  • √ Authenticate with Mashov
  • √ Get basic user data (Grades, photos, behavior)
  • Send messages

Progress

| Module | Status | Notes | | ------------- |-------------: | ------- | | Basic Info | 100% | All planned features implemented. | | Authentication| 100% | All planned features implemented. | | Mail Class | 80% | Sending messages |

FAQ

Is this library legal? Does it use hacking?

This library is 100% legal, and does not use hacking at all. It uses requests Mashov makes, and only gives data to an authenticated user!

Can I contribute?

Any contribution will be amazing, feel free to submit a PR.