GithubHelp home page GithubHelp logo

luccasr73 / loterias-caixa-scraper Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 85 KB

A nodejs module that allows you to pick up data from the lottery of the Brazilian Caixa Econômica Federal

License: MIT License

JavaScript 100.00%
loterias caixa-economica-federal nodejs library module modulo

loterias-caixa-scraper's Introduction

Loterias caixa scraper

Allows you to pick up data from the lottery of the Brazilian Caixa Econômica Federal

NOTICE

This package doesn't work anymore

Supported Raffles

  • Megasena
  • Quina
  • Lotofacil(coming soon)

Install

npm i loterias-caixa-scraper --save

Usage

const lottery = require('loterias-caixa-scraper')
// or import
import { resultByNumber } from 'loterias-caixa-scraper'

Get last result

//get the last megasena result data
lottery
  .resultByNumber('megasena')
  .then((result) => {
    console.log(result)
  })
  .catch((e) => {
    console.log(e)
  })

Get an especific result by number

// to get especific megasena result data by number
lottery
  .resultByNumber('megasena', 2117)
  .then((result) => {
    console.log(result)
  })
  .catch((e) => {
    console.log(e)
  });

PAYLOAD SAMPLE

Mega Sena

{
  numberRaffle: '2196',
  locationRaffle: 'Espaço Loterias Caixa,SÃO PAULO,SP',
  unorNumbers: '56,28,27,01,41,25',
  orderedNumbers: '01,25,27,28,41,56',
  date: '09/10/2019',
  totalCollection: '47.650.095,50',
  isAccumulated: true,
  sena: { winners: '0', prizeByWinner: '0,00' },
  quina: { winners: '58', prizeByWinner: '47.367,07' },
  quadra: { winners: '4166', prizeByWinner: '942,07' },
  nextRaffle:
   { date: '14/10/2019',
     estimatedPrize: '30.000.000,00',
     accumulated: '23.966.764,20' },
  accumulatedMegavirada: '78.486.853,38'
}

Quina

{
  numberRaffle: '5095',
  locationRaffle: 'Espaço Loterias Caixa,SÃO PAULO,SP',
  unorNumbers: '20,49,24,31,39',
  orderedNumbers: '20,24,31,39,49',
  date: '11/10/2019',
  totalCollection: '11.741.050,50',
  isAccumulated: true,
  quina: { winners: '0', prizeByWinner: '0,00' },
  quadra: { winners: '114', prizeByWinner: '5.938,03' },
  terno: { winners: '8388', prizeByWinner: '121,35' },
  duque: { winners: '206346', prizeByWinner: '2,71' },
  nextRaffle:
   { date: '14/10/2019',
     estimatedPrize: '8.000.000,00',
     accumulated: '6.818.572,93' },
  accumulatedSaoJoao: '42.920.270,19'
}

Lotofacil

{
  numberRaffle: '1876',
  locationRaffle: 'SÃO PAULO,SP,Espaço Loterias Caixa',
  unorNumbers: '20,08,03,23,18,11,19,02,01,07,16,24,13,22,04',
  orderedNumbers: '01,02,03,04,07,08,11,13,16,18,19,20,22,23,24',
  date: '11/10/2019',
  totalCollection: '42.351.326,00',
  isAccumulated: false,
  acertos15: { winners: '4', prizeByWinner: '1.311.951,75' },
  acertos14: { winners: '968', prizeByWinner: '1.378,46' },
  acertos13: { winners: '32955', prizeByWinner: '20,00' },
  acertos12: { winners: '407548', prizeByWinner: '8,00' },
  acertos11: { winners: '1942009', prizeByWinner: '4,00' },
  nextRaffle:
   { date: '14/10/2019',
     estimatedPrize: '2.000.000,00',
     accumulated: '8.454.762,05' }
}

CLI

loterias-caixa r [type]
loterias-caixa r [type] [number]

Methods

resultByNumber(typeRaffle, numberRaffle)

typeRaffle: String,
numberRaffle: Number

Return raffle data
If number is undefined, this method will return the last raffle data

Dev

To edit, lint and build

npm run clean: Clean builds
npm run lint: Check for errors
npm run build: Generate minified build with source-maps
npm run watch: Generate minified build with source-maps on save
npm run prepare: Clean and build

PRs are appreciated!

License

MIT

loterias-caixa-scraper's People

Contributors

aeciolevy avatar luccasr73 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

aeciolevy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.