Permalink
Browse files

opening the winners meetup.com avatar in a web browser if they win

  • Loading branch information...
1 parent 5cb8738 commit 8dc645de9fca7caaf7d3719dbd99abfe51280f57 @andrewschoen committed Mar 22, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 raffle.py
View
6 raffle.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import random
+import webbrowser
from pythonkc_meetups import PythonKCMeetups
from optparse import OptionParser
@@ -8,7 +9,10 @@ def raffle_time(api_key=None, event_id=None):
client = PythonKCMeetups(api_key=api_key)
attendees = client.get_event_attendees(event_id)
winner = random.choice(attendees)
- print "And the winner is, %s" % winner.name
+ if winner.photo:
+ webbrowser.open_new(winner.photo.url)
+ print "\n\nAnd the winner is, %s \n\n" % winner.name
+
if __name__ == '__main__':
parser = OptionParser()

0 comments on commit 8dc645d

Please sign in to comment.