Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

[DEPRECATED] An StdLib microservice for selecting raffle winners at a Meetup event.

License

Notifications You must be signed in to change notification settings

wKovacs64/meetup-raffle-stdlib

Repository files navigation

[DEPRECATED]

Warning: this project is no longer maintained. Please see wKovacs64/meetup-raffle for similar functionality.


meetup-raffle-stdlib

An StdLib microservice for selecting a raffle winner at a Meetup event.

Build Status Code Coverage

The default (and only) function:

Description

Selects some random attendees from those who RSVP'd "yes" for the event. Event hosts are excluded.

Parameters
  • 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)
Data Returned

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"
    }
  ]
}
Usage
Command-line:

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
HTTP:
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
Web and Node.js:
const lib = require('lib');

lib.wKovacs64['meetup-raffle']({ meetup: 'your-group-name' })
  .then(data => {
    // handle data
  })
  .catch(err => {
    // handle error
  });

Limitations

  • 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.

About

[DEPRECATED] An StdLib microservice for selecting raffle winners at a Meetup event.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published