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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ucsd-sso-crawler

v1.0.2

Published

A stupid way to crawl into UCSD student SSO, using phantomjs to automate the process of login.

Readme

ucsd-sso-crawler

A stupid way to crawl into UCSD student SSO, using phantomjs to automate the process of login.

I would really appreciate if someone could tell me the way to login to UCSD student SSO, using only http request, respond without the heavy phantomjs instance.

Example

Verify UCSD student credential


// Uncomment below the line to enable debug print
// or run `DEBUG=* node index` to enable debug print
// process.env.DEBUG = '*';

var crawler = require("ucsd-sso-crawler");

crawler.authenticateUser(
    "username",
    "password",
    console.log,
    () => { console.log("Valid UCSD Student Credential!"); }
);

// console.log logs reason string for failure
// If credential is correct, "Valid UCSD Student Credential!" is printed

Get Academic History of the Student


// Uncomment below the line to enable debug print
// or run `DEBUG=* node index` to enable debug print
// process.env.DEBUG = '*';

var crawler = require("ucsd-sso-crawler");

crawler.getAcademicHistory(
    "username",
    "password",
    console.log,
    (report) => { console.log(JSON.stringify(report, null, 2)); },
    false     // set to true, if you want the raw web page html
);

Result of Academic History JSON has following fields


{
  "generalInfo": {
    "name": "Doe, John",                
    "pid": "A01234567",                 
    "level": "UN",                     
    "college": "Revelle College",       
    "major": "Computer Science",        
    "degree": "Bachelor of Science"
  },
  "gradeOptions": {
    "letter": {
      "attendCredit": "94.00",
      "passedCredit": "94.00",
      "gpaCredit": "94.00",
      "sumGPA": "354.60",
      "avgGPA": "3.772"
    },
    "pnp": {
      "attendCredit": "3.00",
      "passedCredit": "49.00",
      "gpaCredit": "0.00",
      "sumGPA": "0.00",
      "avgGPA": "0.000"
    },
    "all": {
      "attendCredit": "97.00",
      "passedCredit": "143.00",
      "gpaCredit": "94.00",
      "sumGPA": "354.60",
      "avgGPA": "3.772"
    }
  },
  "transferCredits": [
    {
      "subject": "AP",
      "course": "CH5",
      "title": "Chemistry Advanced Placement Credit",
      "unit": "8.00",
      "grade": "P",
      "term": "SP14",
      "level": "LD",
      "ucsdEquiv": [
        "CHEM 6A",
        "CHEM 6B",
        "CHEM 6C"
      ]
    }
    // ......
  ],
  "ucsdCredits": {
    "SpringQtr2017": [            // Quarter Name + "Qtr" + year
      {
        "subject": "CSE",
        "course": "101",
        "title": "Design & Analysis of Algorithm",
        "units": "4.00",
        "grade": "",              // Empty for unresolved, or letter grade string
        "pointsRepeat": "0.00"
      },
      // ......
    ]
    // .....
  }
}

Installation

npm install ucsd-sso-crawler

Have npm module phantomjs-prebuilt installed in path or have the phantomjs command available globally

API

authenticateUser(username, password, onErr, onSuccess)

Verify if the username/password pair can login to UCSD Student SSO.

| Arguments | Description | | ------------------ |:------------------------ | | username | username | | password | password | | onSuccess | callback exec when credentials are valid, takes no arguments | | onErr | callback exec when error occurs, takes err reason as string |

getAcademicHistory(username, password, onErr, onSuccess, [raw])

Get the students academic history as JSON, or HTML string in JSON, if credentials are valid

| Arguments | Description | | ------------------ |:------------------------ | | username | username | | password | password | | onSuccess | callback exec when credentials are valid, takes JSONas argument | | onErr | callback exec when error occurs, takes err reason as string | | raw | true, if you want raw html content(contains extra info ex: grade distribution of the classes taken) in JSON |

getAcademicHistory(username, password, onErr, onSuccess, [raw])

Get the students academic history and degree audit HTML string as JSON, or 2 HTML string in JSON, if credentials are valid

| Arguments | Description | | ------------------ |:------------------------ | | username | username | | password | password | | onSuccess | callback exec when credentials are valid, takes JSON as argument | | onErr | callback exec when error occurs, takes err reason as string | | raw | true, if you want academic history raw html content |

Issues

Even querying 2 users academic history at the same time increases the failure rate by a lot.

I guess concurrency went wrong somewhere, or phantomjs costs too much cpu power.

I'd better add a queue inside, or you may wrap a queue outside for now.

License

Copyright (c) Chenxu Jiang [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.