Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barryhughes/9b4cad4fa3c72db202f75fd37a776fde to your computer and use it in GitHub Desktop.
Save barryhughes/9b4cad4fa3c72db202f75fd37a776fde to your computer and use it in GitHub Desktop.
<?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