Created
July 13, 2021 07:17
-
-
Save uzulla/9037ec8f4712bd870145aed1e827060d 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 | |
// dump list attendees from eventbrite event. | |
$conf = include("config.php"); | |
// the config php like as | |
// <?php | |
// | |
// return [ | |
// "token"=>"***", | |
// "event_id"=>"1234567890", | |
// ]; | |
$continuation = ""; | |
$has_more_items = true; | |
$attendees = []; | |
while($has_more_items===true) { | |
echo "."; | |
$json = file_get_contents("https://www.eventbriteapi.com/v3/events/{$conf["event_id"]}/attendees/?token={$conf["token"]}&continuation={$continuation}"); | |
$data = json_decode($json); | |
// var_dump($data->pagination); | |
$continuation = $data->pagination->continuation; | |
$has_more_items = $data->pagination->has_more_items; | |
$attendees = array_merge($attendees, $data->attendees); | |
} | |
echo PHP_EOL; | |
var_dump($attendees[0]); | |
file_put_contents("full_attendee.json", json_encode($attendees, JSON_PRETTY_PRINT)); | |
echo PHP_EOL."done! see full_attendee.json"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment