-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
39 lines (34 loc) · 1.38 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const meetupLuckyWinnerGenerator = require('./meetupLuckyWinnerGenerator');
// replace with:
// const meetupLuckyWinnerGenerator = require('meetup-lucky-winner-generator');
// Set the options for what meetup and event you want to get the lucky winner
require('dotenv').config();
const options = {
meetup: process.env.MEETUP, // Add your Meetup here!
eventId: process.env.EVENT_ID, // Add your event ID here!,
numberOfWinners: process.env.NUMBER_OF_WINNERS, // Add your winner count here!
apiKey: process.env.API_KEY // Add your API KEY!
};
// Generate the lucky winner with the given options
meetupLuckyWinnerGenerator
.generateOneLuckyWinner(options)
.then(luckyWinner => console.log(`Today's lucky winner is ${luckyWinner.member.name}!`))
.catch(err => console.error('Invalid options: ', err.message));
meetupLuckyWinnerGenerator
.generateThreeLuckyWinners(options)
.then(luckyWinners => {
console.log('Today\'s lucky winners are:');
luckyWinners.forEach(e => {
console.log(' - ' + e.member.name);
});
})
.catch(err => console.error('Invalid options: ', err.message));
meetupLuckyWinnerGenerator
.generateCustomLuckyWinners(options)
.then(luckyWinners => {
console.log('Today\'s lucky winners are:');
luckyWinners.forEach(e => {
console.log(' - ' + e.member.name);
});
})
.catch(err => console.error('Invalid options: ', err.message));