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

buscacursos-uc

v4.0.1

Published

BuscaCursos UC Client

Downloads

20

Readme

Buscacursos UC Client

Build Status dependencies dev-dependencies

Perform queries to buscacursos.uc.cl and get the results as JSON objects.

Install

Using npm:

npm install --save buscacursos-uc

Usage

import fetch from 'node-fetch';
import cheerio from 'cheerio';
import buscacursos from 'buscacursos-uc';

const client = buscacursos({ fetch, $: cheerio });

const query = {
  'cxml_semestre': '2016-2',
  'cxml_sigla': 'ICS2613',
};

// It's a Promise!
client.getCourses(query)
  .then(courses => {
    const promises = courses.map(course => {
      return Promise.all([
        client.getInformation(course).then(information => Object.assign(course, { information })),
        client.getRequisites(course).then(requisites => Object.assign(course, { requisites })),
      ]).then(() => course).catch(err => course); // return course as the result of the promise chain
    });
    return Promise.all(promises);
  })
  .then(courses => {
    console.log(JSON.stringify(courses, null, 4));
  })
  .catch(err => {
    console.error(err);
  });

Query

The query comes from the website, the following are the arguments you can pass:

cxml_semestre

  • Required
  • Example: 2016-1

cxml_sigla

  • Example: MAT1630

cxml_nombre

  • Example: Ingeniería de software

cxml_profesor

  • Example: Reutter Juan

cxml_campus

  • Example: San Joaquín

cxml_unidad_academica

  • Example: Arte

cxml_horario_tipo_busqueda

cxml_horario_tipo_busqueda_actividad

Results

The results are from page of at most 50 courses. The Promise returns an array of courses with the following schema:

Example

{
    "year": 2016,
    "period": 2,
    "school": "Ingeniería",
    "NRC": "13530",
    "initials": "ICS2613",
    "droppable": true,
    "english": false,
    "section": 1,
    "specialApproval": false,
    "category": "",
    "name": "Contabilidad y Control de Gestión",
    "campus": "San Joaquín",
    "credits": "10",
    "vacancy": {
        "total": 85,
        "available": 3
    },
    "schedule": {
        "raw": [
            {
                "type": "CLAS",
                "when": "M-J:4",
                "where": "E11"
            },
            {
                "type": "AYU",
                "when": "W:5",
                "where": "B17"
            }
        ],
        "schematic": [
            {
                "day": "M",
                "hours": [
                    {
                        "hour": "4",
                        "module": {
                            "type": "CLAS",
                            "classroom": "E11",
                            "campus": "San Joaquín"
                        }
                    }
                ]
            },
            {
                "day": "J",
                "hours": [
                    {
                        "hour": "4",
                        "module": {
                            "type": "CLAS",
                            "classroom": "E11",
                            "campus": "San Joaquín"
                        }
                    }
                ]
            },
            {
                "day": "W",
                "hours": [
                    {
                        "hour": "5",
                        "module": {
                            "type": "AYU",
                            "classroom": "B17",
                            "campus": "San Joaquín"
                        }
                    }
                ]
            }
        ],
        "normalized": {
            "M": {
                "4": {
                    "type": "CLAS",
                    "classroom": "E11",
                    "campus": "San Joaquín"
                }
            },
            "J": {
                "4": {
                    "type": "CLAS",
                    "classroom": "E11",
                    "campus": "San Joaquín"
                }
            },
            "W": {
                "5": {
                    "type": "AYU",
                    "classroom": "B17",
                    "campus": "San Joaquín"
                }
            }
        }
    },
    "teachers": [
        {
            "name": "Soto Carlos",
            "photoUrl": "http://buscacursos.uc.cl/getFotoProfe.db.php?nombre=Soto%20Carlos&semestre=2016-2&sigla=ICS2613&seccion=1"
        }
    ],
    "information": "El propósito de este curso es introducir al alumno a los principios, conceptos y supuestos utilizados en la contabilidad financiera. Se discutirán los usos y limitaciones de los Estados Financieros a partir de una perspectiva de los procedimientos contables utilizados para realizarlos y, así, entenderlos comprehensivamente. En todo caso, el énfasis del curso se concentrará en el uso de la información contable para la evaluación de la gestión y riesgo de las corporaciones bajo análisis.",
    "requisites": {
        "raw": [
            [
                "No tiene",
                "No tiene",
                "(Creditos >= 270)"
            ],
            [
                "(ICS2512 o ICS2522)"
            ]
        ]
    }
}

Build

To 'transpile' the code and prepare the release:

npm run build && npm run build:umd && npm run build build:umd:min

Testing

Clone the project and run:

npm test