Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
# Quickly generate a set of test events on Eventbrite.com
# (from within a WordPress environment - useful for setting
# up test scenarios etc).
$token = '--YOUR-TOKEN-HERE--';
$date = date_create( '2019-01-01 12:00:00' );
for ( $i = 0; $i <= 60; $i++ ) {
$date->modify( '+2 days' );
$date_string = $date->format( 'Y-m-d' );
echo "CREATING EVENT #$i\n";
echo wp_remote_retrieve_body( wp_remote_post( add_query_arg( [
'event.name.html' => 'Test event ' . $i . ' | ' . uniqid(),
'event.start.utc' => $date_string . 'T13:00:00Z',
'event.start.timezone' => 'America/Vancouver',
'event.end.utc' => $date_string . 'T14:00:00Z',
'event.end.timezone' => 'America/Vancouver',
'event.currency' => 'CAD',
],
"https://www.eventbriteapi.com/v3/events/?token=$token"
) ) ) . "\n\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.