Created
August 15, 2012 19:58
-
-
Save aleborba/3363115 to your computer and use it in GitHub Desktop.
Gerador de .csv com nome, sobrenome para eventos do Eventbrite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import csv | |
import sys | |
import eventbrite | |
id = sys.argv | |
app_key = id[1] | |
user_key = id[2] | |
id = id[3] | |
tokens = {'app_key': app_key, 'user_key': user_key} | |
client = eventbrite.EventbriteClient(tokens) | |
response = client.event_list_attendees({'id': id}) | |
arquivo = open('lista.csv', 'wb') | |
lista = csv.writer(arquivo) | |
for convidado in response.get('attendees'): | |
nome = convidado.get('attendee').get('first_name') | |
sobrenome = convidado.get('attendee').get('last_name') | |
lista.writerow([nome.encode('utf-8'), sobrenome.encode('utf-8')]) | |
arquivo.close() | |
#Use: $ python eb_lista.py app_key user_key event_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment