Created
September 5, 2018 13:15
-
-
Save barryhughes/9b4cad4fa3c72db202f75fd37a776fde to your computer and use it in GitHub Desktop.
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
<?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