Skip to content

Instantly share code, notes, and snippets.

@Qalthos
Last active December 25, 2015 00:39
Show Gist options
  • Save Qalthos/6889584 to your computer and use it in GitHub Desktop.
Save Qalthos/6889584 to your computer and use it in GitHub Desktop.
eventbrite grab attendees
import eventbrite
eb_tokens = dict(app_key='APPLICATION_KEY')
eb_cl = eventbrite.EventbriteClient(eb_tokens)
response = eb_cl.event_list_attendees(dict(id='8645022495',
only_display='first_name,last_name,answers'))
attendees = list()
for a_dict in response['attendees']:
a_dict = a_dict['attendee']
attendee = dict(first_name=a_dict['first_name'],
last_name=a_dict['last_name'])
for an_dict in a_dict['answers']:
an_dict = an_dict['answer']
if an_dict['question'] == 'Twitter':
key = 'twitter'
else:
key = 'topic'
attendee[key] = an_dict['answer_text']
attendees.append(attendee)
with open('attendees.yaml', 'w') as yamlfile:
yaml.dump(attendees, yamlfile)
@ralphbean
Copy link

Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment