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

@aurmeneta/buscacursos-uc

v2.2.1

Published

Obtener cursos desde buscacursos.uc.cl

Downloads

40

Readme

BuscaCursosUC

Paquete npm para hacer scraping de buscacursos.uc.cl. Permite buscar y obtener un array con cursos de la UC.

Instalación

Paquete disponible en NPM.

npm install --save @aurmeneta/buscacursos-uc

Uso

Incluye el paquete en tu proyecto y realiza la búsqueda.

const { cursos, catalogo, cupos } = require("@aurmeneta/buscacursos-uc");

// Buscar cursos
let porNombre = await cursos.buscarCurso("2020-1", "Cálculo II");
let porSigla = await cursos.buscarSigla("2020-1", "MAT1620");
let porProfesor = await cursos.buscarProfesor("2020-1", "Torres");

// Obtener períodos disponibles
let periodos = await cursos.obtenerPeriodos();

// Obtener cupos desagregados de un curso
let cupos = await cupos.obtenerCupos("2022-1", "MAT1620");

// Obtener requisitos, restricciones y equivalencias de un curso
let detallesCurso = await catalogo.obtenerDetallesCurso(14275)

Cada búsqueda retorna un arreglo con los cursos encontrados.

// Búsqueda de cursos
[
  {
    nrc: '14823',
    sigla: 'MAT1620',
    seccion: 1,
    nombre: 'Cálculo II',
    profesor: [ 'Zegarra Luis', 'Rojas Carlos' ],
    vacantes_disponibles: 3,
    horario: [
      { tipo: 'CLAS', dia: 'L', modulo: 5, sala: 'K203' },
      { tipo: 'CLAS', dia: 'W', modulo: 5, sala: 'K203' },
      { tipo: 'CLAS', dia: 'J', modulo: 5, sala: 'K203' },
      { tipo: 'AYU', dia: 'V', modulo: 1, sala: 'AE102' },
      { tipo: 'LAB', dia: 'V', modulo: 6, sala: 'SIN SALA' }
    ]
  },
  ...
]

// Periodos
[ '2022-1', '2021-3', '2021-2', ... ]

// Cupos
{
  nrc: 14275,
  sigla: 'EYP2114-1',
  vacantesDisponibles: 31,
  cupos: [
    {
      escuela: 'Vacantes libres',
      vacantesOfrecidas: 30,
      vacantesOcupadas: 17,
      vacantesDisponibles: 13
    },
    {
      escuela: '04 - Ingeniería',
      vacantesOfrecidas: 60,
      vacantesOcupadas: 44,
      vacantesDisponibles: 16
    },
    {
      escuela: '09 - Lic. Generales (College)',
      vacantesOfrecidas: 5,
      vacantesOcupadas: 3,
      vacantesDisponibles: 2
    }
  ]
}
// Detalles Curso
{
  prerrequistos: [
    [ {sigla: "FIS0152", correquisito: true}, {sigla: "MAT1620", correquisito: false} ],
    ...
  ],
  restricciones: '(Programa=Lic en Ing Cs de Datos)',
  relacion: 'o',
  equivalencias: [ 'FIS1522', 'ICM1003', 'IIQ1002', 'IIQ1003', 'IIQ103H' ]
}

CORS

Si la consulta se realiza directamente desde un navegador, esta será rechazada porque, por defecto, la respuesta no incluye los headers para CORS. Para inlcuirlos, se debe realizar un proxy de buscacursos o el cátalogo que las incluya e indicar el url como páramentro en las solicitudes.

const buscaCursos = require("@aurmeneta/buscacursos-uc");

let porNombre = await buscaCursos.buscarCurso("2020-1", "Cálculo II", "https://buscacursos.proxy.example/");
let porSigla = await buscaCursos.buscarSigla("2020-1", "MAT1620",  "https://buscacursos.proxy.example/");
let porProfesor = await buscaCursos.buscarProfesor("2020-1", "Torres",  "https://buscacursos.proxy.example/");

let periodos = await cursos.obtenerPeriodos("https://buscacursos.proxy.example/")

let cupos = await cupos.obtenerCupos("2022-1", "MAT1620", "https://buscacursos.proxy.example/");

let detallesCurso = await catalogo.obtenerDetallesCurso(14275, "https://catalogo.proxy.example/");)