Skip to content

Commit 11bbbcb

Browse files
committed
it's raffle time
1 parent b525f76 commit 11bbbcb

File tree

5 files changed

+45
-0
lines changed

5 files changed

+45
-0
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Andrew Schoen <andrew.schoen@gmail.com>

LICENSE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Copyright (c) 2011, Andrew Schoen
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
* Neither the name of the Salva O'Renick nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9+
10+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Python KC Raffler
2+
=================
3+
4+
Just a really simple script I use to raffle giveaways from the PythonKC meetup.com RSVP list.
5+
6+
You'll need your meetup.com API Key and the event_id you want to pull the RSVP list for.
7+
8+
Usage
9+
-----
10+
11+
::
12+
>>python raffle.py -k '<your_api_key' -e <meetup_event_id>
13+

raffle.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
import random
3+
4+
from pythonkc_meetups import PythonKCMeetups
5+
from optparse import OptionParser
6+
7+
def raffle_time(api_key=None, event_id=None):
8+
client = PythonKCMeetups(api_key=api_key)
9+
attendees = client.get_event_attendees(event_id)
10+
attendee_names = [rsvp.name for rsvp in attendees]
11+
print random.choice(attendee_names)
12+
13+
if __name__ == '__main__':
14+
parser = OptionParser()
15+
parser.add_option("-k", "--key", help="api key for meetup.com",
16+
dest="api_key", type="string")
17+
parser.add_option("-e", "--event_id", help="event id from meetup.com",
18+
dest="event_id", type="int")
19+
options, args = parser.parse_args()
20+
raffle_time(api_key=options.api_key, event_id=options.event_id)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-e git://github.com/pythonkc/pythonkc-meetups.git#egg=pythonkc-meetups

0 commit comments

Comments
 (0)