Comparing version 0.0.9 to 0.0.10
{ | ||
"name": "jsjiit", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Browser-compatible API for interacting with JIIT (Jaypee Institute of Information Technology) WebPortal. Bypasses CAPTCHA :)", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
105
README.md
@@ -1,39 +0,44 @@ | ||
# 🎓 JIIT Web Portal Wrapper | ||
# 🎓 JSJIIT - JIIT Web Portal Wrapper | ||
Because manually checking attendance is *so* 2010. Let's automate that anxiety! | ||
because manually checking attendance is destroying my mental health fr fr (and because i'm running out of "why did I even do that" moments) | ||
## 🤔 What's This? | ||
## what even is this | ||
A JavaScript wrapper that lets you programmatically interact with JIIT's web portal. Think of it as your personal assistant who actually *enjoys* dealing with the portal (weird, right?). | ||
a browser-compatible javascript wrapper that lets you programmatically interact with JIIT's web portal. one must imagine the developer happy. | ||
## ✨ Features | ||
god knew i'd be too powerful if I could solve captchas everyday so here we are | ||
- 🔐 Login without playing "solve the CAPTCHA 🔫" | ||
- 📊 Get attendance details | ||
- 📝 Check exam schedules | ||
- 📈 Fetch those grades you're too scared to look at | ||
- 👀 View SGPA/CGPA | ||
## ✨ features (real) | ||
## 🚀 Usage | ||
- 🔐 login without the captcha (thanks to da goat [codelif](https://github.com/codelif/)) | ||
- 📊 get attendance details (or don't, ignorance is bliss) | ||
- 📝 check exam schedules (trauma incoming) | ||
- 📈 fetch grades (fuck grades) | ||
- 👀 view SGPA/CGPA (this healing shit taking forever) | ||
First, import our little miracle worker: | ||
## how to use this (if you're still here) | ||
first import the `WebPortal` class inside a `<script type="module">` tag: | ||
```javascript | ||
import { WebPortal } from './src/wrapper.js'; | ||
import { WebPortal } from 'https://cdn.jsdelivr.net/npm/jsjiit@0.0.10/dist/jsjiit.min.esm.js'; | ||
``` | ||
Then, let the magic begin: | ||
> [!IMPORTANT] | ||
> if this version causes issues, use the latest version from the cdn (even if i forget to update these docs). use the [npm link](https://www.npmjs.com/package/jsjiit) to find the latest version number. | ||
then let's speedrun this depression: | ||
```javascript | ||
// Create your portal buddy | ||
// create your portal buddy (they won't leave you like she did) | ||
const portal = new WebPortal(); | ||
``` | ||
```javascript | ||
// Login (fingers crossed!) | ||
// login (fingers crossed bestie) | ||
await portal.student_login('your_username', 'your_password'); | ||
``` | ||
### All of the following endpoints can only be accessed after loggin in: | ||
#### everything below needs login: | ||
```javascript | ||
// Check grades (maybe don't) | ||
// check grades (don't) | ||
const gradeCardSems = await portal.get_semesters_for_grade_card(); | ||
@@ -43,3 +48,25 @@ const latestSem = gradeCardSems[0]; | ||
``` | ||
```javascript | ||
// get attendance (prepare for disappointment) | ||
const meta = await portal.get_attendance_meta(); | ||
const sem = meta.latest_semester(); | ||
const header = meta.latest_header(); | ||
const attendance = await portal.get_attendance(header, sem); | ||
``` | ||
```javascript | ||
// Get attendace for every class of a subject | ||
const subjectIndex = 1; | ||
let subjectid = attendance["studentattendancelist"][subjectIndex]["subjectid"]; | ||
let individualsubjectcode = attendance["studentattendancelist"][subjectIndex]["individualsubjectcode"]; | ||
const possibleComponentCodes = ["Lsubjectcomponentid", "Psubjectcomponentid", "Tsubjectcomponentid"] | ||
let subjectcomponentids = []; | ||
for (let possibleComponentCode of possibleComponentCodes) { | ||
if (attendance["studentattendancelist"][subjectIndex][possibleComponentCode]) { | ||
subjectcomponentids.push(attendance["studentattendancelist"][subjectIndex][possibleComponentCode]); | ||
} | ||
} | ||
let subjectAttendance = await w.get_subject_daily_attendance(sem, subjectid, individualsubjectcode, subjectcomponentids); | ||
``` | ||
```javascript | ||
// Check SGPA & CGPA | ||
@@ -71,22 +98,18 @@ const sgpaCgpa = await w.get_sgpa_cgpa(); | ||
``` | ||
```javascript | ||
// Get attendance (prepare for disappointment) | ||
const meta = await portal.get_attendance_meta(); | ||
const sem = meta.latestSemester(); | ||
const header = meta.latestHeader(); | ||
const attendance = await portal.get_attendance(header, sem); | ||
``` | ||
```javascript | ||
// Get attendace for every class of a subject | ||
const subjectIndex = 1; | ||
let subjectid = attendance["studentattendancelist"][subjectIndex]["subjectid"]; | ||
let individualsubjectcode = attendance["studentattendancelist"][subjectIndex]["individualsubjectcode"]; | ||
const possibleComponentCodes = ["Lsubjectcomponentid", "Psubjectcomponentid", "Tsubjectcomponentid"] | ||
let subjectcomponentids = []; | ||
for (let possibleComponentCode of possibleComponentCodes) { | ||
if (attendance["studentattendancelist"][subjectIndex][possibleComponentCode]) { | ||
subjectcomponentids.push(attendance["studentattendancelist"][subjectIndex][possibleComponentCode]); | ||
} | ||
} | ||
let subjectAttendance = await w.get_subject_daily_attendance(sem, subjectid, individualsubjectcode, subjectcomponentids); | ||
``` | ||
## we're all gonna make it | ||
if this wrapper helped you avoid a mental breakdown, consider starring the repo (parasocial validation appreciated) | ||
## disclaimer | ||
not liable for any emotional damage caused by viewing your attendance. that's between you and god fr | ||
## special thanks | ||
massive shoutout to [codelif](https://github.com/codelif/) for creating [pyjiit](https://pyjiit.codelif.in/introduction.html).\ | ||
y'all should check out pyjiit, it's the original goat that made jsjiit possible. | ||
## future | ||
- me: be funny | ||
- repo: be funnier | ||
- both: we're so back |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
164242
113