Warning: this project is no longer maintained. Please see wKovacs64/meetup-raffle for similar functionality.
An StdLib microservice for selecting a raffle winner at a Meetup event.
Selects some random attendees from those who RSVP'd "yes" for the event. Event hosts are excluded.
meetup
: the name of the Meetup group (required)specificEventId
: the ID of a particular event (optional, default: soonest upcoming/in-progress event)meetupApiKey
: your private Meetup API key (optional, default: none)count
: the number of winners to draw (optional, default: 1)
Returns a JSON object containing a winners
array of attendee objects (the
raffle winners), or an StdLib error message in the event of a failure. Each
attendee object includes the name
, photoURL
, and profileURL
properties as
strings (forwarded on from the meetup-randomizer
library).
{
"winners": [
{
"name": "Tiny Rick",
"photoURL": "https://i.imgur.com/rgDv1wB.jpg",
"profileURL": "http://rickandmorty.wikia.com/wiki/Tiny_Rick"
}
]
}
Select a raffle winner from the soonest upcoming or currently in-progress event:
$ lib wKovacs64.meetup-raffle --meetup your-group-name
Optionally specify a particular event by ID:
$ lib wKovacs64.meetup-raffle --meetup your-group-name --event 123456789
Or, shorthand for the same request:
$ lib wKovacs64.meetup-raffle your-group-name 123456789
Draw multiple winners at once:
$ lib wKovacs64.meetup-raffle --meetup your-group-name --count 3
To authenticate requests (which retrieves full names rather than abbreviated last names), provide your own private Meetup API key:
$ lib wKovacs64.meetup-raffle your-group-name --meetupApiKey XXXXXXXXXXX
https://wkovacs64.lib.id/meetup-raffle/?meetup=your-group-name
Or, perform an authenticated request:
https://wkovacs64.lib.id/meetup-raffle/?meetup=your-group-name&meetupApiKey=XXXXXXXXXXX
const lib = require('lib');
lib.wKovacs64['meetup-raffle']({ meetup: 'your-group-name' })
.then(data => {
// handle data
})
.catch(err => {
// handle error
});
-
Event hosts are excluded from winning.
Reason: This choice is made for us in the
meetup-randomizer
dependency. -
Successful results are only possible for completely public events.
Reason: This is a Meetup API restriction.