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

dados-ufc

v1.0.4

Published

Busca de dados no site da Universidade Federal do Ceará

Downloads

10

Readme

O que é?

Basicamente um wrapper para busca de dados no site da universidade.

Criei um módulo ao invés de uma api devido aos custos e possível latência, então qualquer um que se sinta apto a contribuir ou utilizar é bem vindo!

Como usar?

Como é um scraper, existe uma latência considerável entre a requisição e a resposta do servidor, então usamos o modelo assíncrono (Promise-Based).

Listando coleções de notícias

Para mostrar notícias de anos anteriores.

const ufc = require('dados-ufc')

ufc.news.list()
    .then(console.log)
    // {
    //     data: [
    //       {
    //         id: 'noticias-ufctv',
    //         name: 'Notícias UFCTV',
    //         link: 'http://www.ufc.br/noticias/noticias-ufctv'
    //       },
    //       {
    //         id: 'noticias-de-2020',
    //         name: 'Notícias de 2020',
    //         link: 'http://www.ufc.br/noticias/noticias-de-2020'
    //       },
    //       {
    //         id: 'noticias-de-2019',
    //         name: 'Notícias de 2019',
    //         link: 'http://www.ufc.br/noticias/noticias-de-2019'
    //       },
    //       ... 8 more items
    //     ],
    //     size: 11
    // }

Buscando notícias

Forma rápida de consultar as ultimas informações publicadas no Portal de Notícias da UFC. Pode ser feita a busca por palavras específicas e ano, conforme o site linkado.

No exemplo a seguir, temos uma busca pela última notícia. A presença da data também é importante, pois podemos selecionar notícias somente do dia atual e realizar o processamento da forma que o desenvolvedor desejar.

const ufc = require('dados-ufc')

ufc.news.show({ limit: 1 })
    .then(console.log)
    // {
    //     id: 'noticias-de-2020',
    //     news: {
    //         data: [{
    //             id: '15240-inscricoes-para-cursos-de-libras-e-esperanto-seguem-ate-esta-quarta-feira-25-exclusivamente-pela-internet',
    //             title: 'Inscrições para cursos de Libras e Esperanto seguem até esta quarta-feira (25) exclusivamente pela Internet',
    //             link: 'http://www.ufc.br/noticias/15240-inscricoes-para-cursos-de-libras-e-esperanto-seguem-ate-esta-quarta-feira-25-exclusivamente-pela-internet',
    //             date: '2020-11-24'
    //         }],
    //         size: 1
    //     },
    //     page: 0,
    //     size: 875,
    //     limit: 1,
    //     search: undefined
    // }

Listando Calendários

Mostra a lista de Calendários Acadêmicos disponíveis no site.

const ufc = require('dados-ufc')

ufc.calendar.list()
    .then(console.log)
    // {
    //     data: [
    //       {
    //         id: '2020-ajustes-apos-aprovacao-do-ppe',
    //         name: '2020 - ajustes após aprovação do PPE',
    //         link: 'http://www.ufc.br/calendario-universitario/2020-ajustes-apos-aprovacao-do-ppe'
    //       },
    //       {
    //         id: '2020',
    //         name: '2020',
    //         link: 'http://www.ufc.br/calendario-universitario/2020'
    //       },
    //       {
    //         id: '2019',
    //         name: '2019',
    //         link: 'http://www.ufc.br/calendario-universitario/2019'
    //       },
    //       ... 5 more items
    //     ],
    //     size: 8
    // }

Eventos no calendário

Já essa função lista os eventos dentro do calendário.

O único filtro passível no momento é o de id. Exemplo ufc.calendar.show({ id: '2020' }) (conforme o exemplo anterior). Se não for passado nada, será mostrado o último calendário.

const ufc = require('dados-ufc')

ufc.calendar.show()
    .then(console.log)
    // {  
    //     id: '2020-ajustes-apos-aprovacao-do-ppe',
    //     events: {
    //       data: [{
    //           summary: 'Feriado Municipal em SOBRAL - Aniversário de Sobral',
    //           start: { dateTime: 2020-07-05T03:00:00.000Z },
    //           end: { dateTime: 2020-07-06T02:59:59.999Z }
    //         }
    //         ... 161 more items
    //       ],
    //       size: 162
    //     }
    // }

Listar pendências na biblioteca

const ufc = require('dados-ufc')

ufc.pergamum.pendencies('login', 'password')
    .then(console.log)
    // [
    //   {
    //     name: 'Algoritmos : teoria e prática / 2002',
    //     returnDate: '07/12/2021',
    //     renewsNumber: '1'
    //   },
    //   {
    //     name: 'Curso de física básica - 3. ed. / 1996',
    //     returnDate: '07/12/2021',
    //     renewsNumber: '0'
    //   }
    // ]

Listar reservas na biblioteca

const ufc = require('dados-ufc')

ufc.pergamum.reservations('login', 'password')
    .then(console.log)
    // [
    //   {
    //     name: 'Algoritmos : teoria e prática / 2002',
    //     status: 'Avaliando'
    //   }
    // ]

Missão

Contribuir de forma positiva para o ambiente acadêmico e facilitar o acesso à informação.

Como contribuir?

  • Basta fazer um fork desse projeto, faça suas alterações e então um pull request quando tudo estiver pronto.
  • Você também pode criar uma issue reportando algum problema ou função que gostaria de ver aqui nesse repositório.
  • Se o projeto for mantido, também será necessária documentação.
  • Ou também, outra forma é entrando em contato pelo email no meu perfil do Github e reportando sua experiência com essa aplicação.

Contribuidores

Qualquer contribuidor será contemplado no arquivo README.md e além disso estará facilitando e muito a vida da comunidade acadêmica.

| @matheus3301 | | :---: |

Autor

| @izaiasmachado | | :---: |