Skip to content

Instantly share code, notes, and snippets.

@iansltx
Created April 30, 2019 18:09
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 iansltx/f069e4af146776c3b22186a72615ed8f to your computer and use it in GitHub Desktop.
Save iansltx/f069e4af146776c3b22186a72615ed8f to your computer and use it in GitHub Desktop.
List of everyone who has submitted Joind.in talk comments for a given event
<?php
$eventId = 7021;
#$eventId = 7045; #Yorkshire, for testing
$comments = json_decode(file_get_contents('https://api.joind.in/v2.1/events/'.$eventId.'/talk_comments?resultsperpage=9999'), true)['comments'];
$users = [];
foreach ($comments as $comment) {
$users[$comment['user_display_name'] . ' (' . $comment['username'] . ')'] = true;
}
uksort($users, function($a, $b) { return strcasecmp($a, $b); });
?>
<ol>
<?php foreach (array_keys($users) as $user): ?>
<li><?= $user ?></li>
<?php endforeach; ?>
</ol>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment