Skip to content

Commit

Permalink
Merge pull request #5 from piontkowski/chores/2017-cleanup
Browse files Browse the repository at this point in the history
Chores/2017-2018 cleanup
  • Loading branch information
ericvanjohnson authored Apr 11, 2018
2 parents 9999381 + c32e30d commit 6aea895
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 174 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/
composer.lock
config.php
config.php
.idea
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ to allow more people to contribute and extend it.

So here it is, feel free to add any improvement or bells and whistles you would like to it.

Thanks to @johncongdon for "making it work"
Thanks to @johncongdon for "making it work" and @piontkowski for putting it on the web.

## Installation

Expand All @@ -21,6 +21,8 @@ Rename ```config-sample.php``` to ```config.php```

Add your Meetup API key to ```config.php```

Add members who you _don't_ want to be part of the drawing to the excluded_member_ids array in ```config.php```

### Command Line

Modify the script ```pickme-cli.php``` and add your Event Id.
Expand Down
1 change: 1 addition & 0 deletions config-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@

$config = array(
'meetup_api' => '<YOUR MEETUP API KEY>',
'excluded_member_ids' => [],
);
4 changes: 2 additions & 2 deletions pickme-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
passthru('clear');

$rsvps = array();
foreach ($meetup_rsvps as $rsvp){
foreach ($meetup_rsvps as $rsvp) {
$rsvps[] = $rsvp;
}

Expand All @@ -44,4 +44,4 @@

print "\r" . str_repeat(' ', $screen_width) . "\r";
print "The winner is" . str_repeat(' ', 80) . "\n";
print $rsvps[0]['member']['name']."\n";
print $rsvps[0]['member']['name'] . "\n";
8 changes: 6 additions & 2 deletions public_html/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
use \DMS\Service\Meetup\MeetupKeyAuthClient;

$client = MeetupKeyAuthClient::factory(array('key' => $config['meetup_api']));
$meetup_rsvps = $client->getRSVPs(array('event_id' => $_POST['event_id'] ));
$meetup_rsvps = $client->getRSVPs(array('event_id' => $_POST['event_id']));

$rsvps = array();
foreach ($meetup_rsvps as $rsvp){
foreach ($meetup_rsvps as $rsvp) {
if (in_array($rsvp['member']['member_id'], $config['excluded_member_ids'])) {
continue;
}

$rsvps[] = $rsvp;
}

Expand Down
95 changes: 49 additions & 46 deletions public_html/index.php
Original file line number Diff line number Diff line change
@@ -1,65 +1,68 @@
<!doctype html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Pickme: Meetup random event winner picker</title>
<meta name="description" content="This app will select a random winner from the Yes RSVP's to a Meetup event given a Meetup event ID and valid API key." />
<meta property="og:type" content="website" />
<meta property="og:title" content="Pickme: Meetup random event winner picker" />
<meta property="og:description" content="This app will select a random winner from the Yes RSVP's to a Meetup event given a Meetup event ID and valid API key." />
<link href='//fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="normalize.css" />
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="fireworks.js/css/fireworks.css" media="screen" />
<script src="fireworks.js/script/soundmanager2-nodebug-jsmin.js"></script>
<script src="fireworks.js/script/fireworks.js"></script>
</head>
<body>
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>Pickme: Meetup random event winner picker</title>
<meta name="description"
content="This app will select a random winner from the Yes RSVP's to a Meetup event given a Meetup event ID and valid API key."/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="Pickme: Meetup random event winner picker"/>
<meta property="og:description"
content="This app will select a random winner from the Yes RSVP's to a Meetup event given a Meetup event ID and valid API key."/>
<link href='//fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="normalize.css"/>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="main.css"/>
<link rel="stylesheet" type="text/css" href="fireworks.js/css/fireworks.css" media="screen"/>
<script src="fireworks.js/script/soundmanager2-nodebug-jsmin.js"></script>
<script src="fireworks.js/script/fireworks.js"></script>
</head>
<body>
<!--
<!--
Fireworks elements (cloned and animated via script):
Fireworks elements (cloned and animated via script):
#fireworks-template
#fireContainer
#fireworks-template
#fireContainer
-->
-->
<div id="fireworks-template">
<div id="fw" class="firework"></div>
<div id="fp" class="fireworkParticle"><img src="fireworks.js/image/particles.gif" alt="" /></div>
</div>
<div id="fireworks-template">
<div id="fw" class="firework"></div>
<div id="fp" class="fireworkParticle"><img src="fireworks.js/image/particles.gif" alt=""/></div>
</div>
<div id="fireContainer"></div>
<div id="fireContainer"></div>
<!--
<!--
Main app.
Main app.
-->
-->
<div id="form-container" class="container">
<div id="form-container" class="container">
Enter details below.
<p></p>
<input type="text" class="form-control input-lg" name="event" id="meetingid" placeholder="Enter Meetup Event ID (Required)" />
<p></p>
<button type="submit" id="submit" class="btn btn-default btn-lg">Choose Winner</button>
Enter details below.
<p></p>
<input type="text" class="form-control input-lg" name="event" id="meetingid"
placeholder="Enter Meetup Event ID (Required)"/>
<p></p>
<button type="submit" id="submit" class="btn btn-default btn-lg">Choose Winner</button>
</div>
</div>
<div id="winner-container" class="container">
<div id="winner-container" class="container">
<div id="winner-banner"></div>
<div id="countdown-timer"></div>
<div id="winner-name"></div>
<div id="winner-photo"></div>
<div id="winner-banner"></div>
<div id="countdown-timer"></div>
<div id="winner-name"></div>
<div id="winner-photo"></div>
</div>
</div>
<script src="//code.jquery.com/jquery-1.11.0.js"></script>
<script src="main.js"></script>
</body>
<script src="//code.jquery.com/jquery-1.11.0.js"></script>
<script src="main.js"></script>
</body>
</html>
Loading

0 comments on commit 6aea895

Please sign in to comment.