get-lottery
v2.1.5
Published
Generate lottery numbers based on probability.
Downloads
7
Readme
A Powerball Lottery api wrapper with added functionality.
Installation
'get-lottery' is an npm module, and as such, can be installed using the install
command.
$ npm install get-lottery
Usage
Get an api key at https://dev.socrata.com/foundry/data.ny.gov/8vkr-v8vh.
let getLottery = require('get-lottery');
//set api key (optional)
getLottery.setKey('bjp8KrRvAPtuf809u1UXnI0Z8');
//generate potential lottery numbers based on data
getLottery.generateNumbers().then(result => {
//returns array of numbers
});
Documentation
setKey
An api key is not required, but will allow you to make more requests per second.
getLottery.setKey('bjp8KrRvAPtuf809u1UXnI0Z8');
getAll
Get all Powerball data since 2010, including date, multiplier, and of course, winning numbers.
getLottery.getAll().then(result => {
//returns array of objects
});
getWinningNumbers
Get only winning number data.
//get winning numbers only
getLottery.getWinningNumbers().then(result => {
//returns array of strings
});
//get winning numbers, counted
getLottery.getWinningNumbers(true).then(result => {
//returns array of objects
//id = number;
//count = how many times the number appears in the data
});
generateNumbers
Based on probability, return an array of numbers consituting future lottery numbers.
getLottery.generateNumbers().then(result => {
//returns array of numbers
});
License
This module is under the MIT License. Feel free to use it to your liking.