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

worldcup-ge

v1.0.2

Published

Um webscraping do site globo esporte, visando obter dados sobre a copa de mundo de 2022 ou anteriores

Downloads

6

Readme

Worldcup-GE

Bot do Discord da copa usando essa lib

Youtube


Portuguese


Essa lib for criada com a inten��o de obter dados da copa do mundo de 2022 ou copas anteriores, essa lib ut�liza webscraping e a api do globo esporte para obter tais dados

  • Intanciando a classe
const { Client } = require("worldcup-ge");
const year = 2022;
const client = new Client(year);
  • Obtendo os grupos
const groups = await client.loadGroups();

Recomendo armazenar o resultado em algum lugar, po�s � um pouco demorado por buscar as partidas em varios endere�os diferentes da api

Essa fun��o retorna uma promise, que por sua vez retorna uma array de grupos

groups[0].id // Id do grupo
groups[0].group_id // Id do grupo tamb�m, vai saber o mot�vo de ter dois
groups[0].name // Nome do grupo
groups[0].games // array de rodadas
groups[0].table // Tabela do grupo
  • Obtendo tabela do grupo
groups[0].table.getTable() // Retorna a classe uma lista de sele��es com as posi��es
const seletions = groups[0].table.getTable();
seletions[0].name // Nome da sele��o no grupo
seletions[0].sigla // Sigla da sele��o no grupo
seletions[0].escudo // Escudo da sele��o no grupo
seletions[0].position // posi��o da sele��o no grupo
seletions[0].pts // Pontos da sele��o no grupo
seletions[0].vitorias // Vitorias da sele��o no grupo
seletions[0].empates // Empates da sele��o no grupo
seletions[0].derrotas // Derrotas da sele��o no grupo
seletions[0].saldo_gols // Saldo de gols da sele��o no grupo
seletions[0].gols_pro // Gols Pro da sele��o no grupo
seletions[0].gols_contra // Gols Contra da sele��o no grupo
seletions[0].aproveitamento // Aproveitamento da sele��o no grupo
seletions[0].position_color // Cor que a posi��o � marcada no site do ge da sele��o no grupo
  • Obtem a lista de rodadas
const rounds = groups[0].games;
rounds[0].name // Nome da rodada
rounds[0].all() // Retorna uma lista de todas as partidas dessa rodada
const matchs = rounds[0].all();
matchs[0].home_seletion // Sele��o mandante
matches[0].result_home // Resultado para a sele��o mandante, gols no tempo normal (null se n�o jogou)
matches[0].result_home_penalti // Resultado para os penaltis para a sele��o mandante, (null se n�o teve disputa de penaltis)
matchs[0].visitante_seletion // Sele��o visitante
matches[0].result_visitante // Resultado para a sele��o visitante, gols no tempo normal (null se n�o jogou)
matches[0].result_visitante_penalti // Resultado para os penaltis para a sele��o visitante, (null se n�o teve disputa de penaltis)
matches[0].complete // Se a partida terminou (n�o testada)
matches[0].id // ID Da partida
matches[0].data // Data da partida (n�o testado nas fases eliminatorias)
matches[0].local // Local da partida