Skip to content

Instantly share code, notes, and snippets.

@uzulla
Created July 13, 2021 07:17
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 uzulla/9037ec8f4712bd870145aed1e827060d to your computer and use it in GitHub Desktop.
Save uzulla/9037ec8f4712bd870145aed1e827060d to your computer and use it in GitHub Desktop.
<?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