Giter VIP home page Giter VIP logo

cu-api's Introduction

cu-api

npm version Release

Disclaimer

This project was created by me (Kyle Pfromer) and has no endorsement by the University of Colorado.

Installation

npm install --save cu-api

yarn add cu-api

Usage

The api code is written with TypeScript, but also works with JavaScript (typings are included).

Create a session and login. Then get all the data you need with the session (the session acts as a logged in user, saving time).

ES6

import { CUSession } from 'cu-api';

(async function () {
  const session = new CUSession();
  await session.init('username', 'password');
  console.log(session.loggedIn);
  console.log(await session.userData());
  console.log(await session.termData());
  console.log(await session.GPA());
  console.log(await session.classTermData('2201'));
})();

ES5

const CUSession = require('cu-api').CUSession;

(async function () {
  const session = new CUSession();
  await session.init('username', 'password');
  console.log(session.loggedIn);
  console.log(await session.userData());
  console.log(await session.termData());
  console.log(await session.GPA());
  console.log(await session.classTermData('2201'));
})();

CLI

Make sure to install libsecret (https://github.com/atom/node-keytar).

How it Works

cu-api uses superagent a http request library to act like a user and login (the CU login process is really convoluted). When logged in it accesses the backend API used by the buffportal Angular application to grab the data you need. You have access to everything the buffportal has access to!

Requirements

You must have nodejs installed. This will not work on the browser since I had to self sign a certificate for buffportal.

License

cu-api is MIT licensed.

cu-api's People

Contributors

kpfromer avatar renovate-bot avatar semantic-release-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar

cu-api's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm querystring Unavailable
npm superagent Unavailable
npm tslint Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @types/node to v13.13.52
  • fix(deps): update dependency cheerio to v1.0.0
  • chore(deps): update dependency inquirer to v8.2.6
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-node action to v4
  • chore(deps): update dependency @types/inquirer to v9
  • chore(deps): update dependency @types/node to v20
  • chore(deps): update dependency @types/superagent to v8
  • chore(deps): update dependency chalk to v5
  • chore(deps): update dependency inquirer to v10
  • chore(deps): update dependency typescript to v5
  • fix(deps): update dependency superagent to v10
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • fix(deps): update dependency moment to v2.29.4 [security]

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/release.yaml
  • actions/checkout v2
  • pnpm/action-setup 646cdf48217256a3d0b80361c5a50727664284f2
  • actions/setup-node v2
npm
package.json
  • cheerio ^1.0.0-rc
  • moment ^2.24.0
  • querystring ^0.2.0
  • ssl-root-cas ^1.3.1
  • superagent ^5.3.1
  • @commitlint/cli 9.1.2
  • @commitlint/config-conventional 9.1.2
  • @semantic-release/changelog 5.0.1
  • @semantic-release/commit-analyzer 8.0.1
  • @semantic-release/git 9.0.0
  • @semantic-release/npm 7.1.1
  • @semantic-release/release-notes-generator 9.0.2
  • @types/cheerio 0.22.21
  • @types/node 13.13.51
  • @types/superagent 4.1.11
  • commitizen 4.2.4
  • cz-conventional-changelog 3.3.0
  • semantic-release 17.4.2
  • ts-node 8.10.2
  • tslint 6.1.3
  • typescript 4.3.5
  • @types/inquirer ^7.3.3
  • chalk ^4.1.2
  • inquirer ^8.1.2
  • node >=8.10.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.