Skip to content

Instantly share code, notes, and snippets.

@cooncesean
Created February 19, 2014 21:00
Show Gist options
  • Save cooncesean/9101451 to your computer and use it in GitHub Desktop.
Save cooncesean/9101451 to your computer and use it in GitHub Desktop.
Adds a number of ToDo's and GearsScheduleItems to a user account on MapYourShow.
import sys
import xmltodict
from suds.client import Client
###### CONFIG #############################################
url = "http://api.mysstaging.com/MYSAgenda.cfc?wsdl" # agenda
client = Client(url)
guid = client.service.ValidateUser("Guidebook", "*8{T=!Rq", "c2e214")
if len(sys.argv) != 2:
raise Exception('You must pass an email to this script.')
email = sys.argv[1]
###### AUTH USER ##########################################
response = client.service.UserExists(guid, email)
data = xmltodict.parse(response)
response = data['MYSResponse']['MYSResponseCodeText']
if response == 'Failure':
raise Exception('User does not exist on MYS.')
###### CREATE AGENDA DATA #################################
print 'CREATING AGENDA DATA'
def add_agenda_data(exhid, name):
client.service.ManageAgenda(guid, action='add', email=email, exhid=exhid)
print ' ADDED POI TO AGENDA: %s' % name
for exhid, name in [(400040, 'Academy of Art University'), (400059, 'Anomaly Productions Inc.'), (400554, 'Kill Shakespeare'), (400562, 'Dr. Who Store')]:
add_agenda_data(exhid, name)
print 'VIEW DATA AT: http://c2e214.mysstaging.com/5_0/myshow/exhibitors.cfm'
print '==============='
###### CREATE SCHEDULE DATA ###############################
print 'CREATING SCHEDULE DATA'
def add_schedule_data(session_id, name):
client.service.AddUserSession(guid, email=email, SessionID=session_id)
print ' ADDED SESSION: %s' % name
SCHEDULE = [
(u'6', u'Test Event 1'),
(u'7', u'Ed Lane Autograpghing'),
# (u'8', u'Creating the "John Lewis the Hater" Series Panel'),
(u'9', u'Another Panel!'),
(u'10', u'Sir Roland Autograpghing')
]
for session_id, name in SCHEDULE:
add_schedule_data(session_id, name)
print 'VIEW DATA AT: http://c2e214.mysstaging.com/5_0/myshow/events.cfm'
print '==============='
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment