Created
July 15, 2017 10:51
-
-
Save jissereitsma/03ac8dc8ef0949b1fc766a94bfc67f55 to your computer and use it in GitHub Desktop.
Dutchento meetup data of all Magento User Groups
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 | |
include_once 'vendor/autoload.php'; | |
use DMS\Service\Meetup\MeetupKeyAuthClient; | |
$apiKey = 'enter-your-own-meetup-api-key'; | |
$client = MeetupKeyAuthClient::factory(array('key' => $apiKey)); | |
$meetupGroupUrlNames = array( | |
'Magento-User-Group-Friesland', | |
'Magento-User-Group-Groningen', | |
'Magento-User-Group-Drenthe', | |
'Magento-User-Group-Flevoland', | |
'Magento-User-Group-Overijssel', | |
'Magento-User-Group-Amsterdam', | |
'Rotterdam-Magento-Meetup', | |
'Magento-User-Group-Gelderland', | |
'Magento-User-Group-Utrecht', | |
'Magento-User-Group-Noord-Brabant', | |
'Magento-User-Group-Zeeland', | |
'Magento-User-Group-Limburg', | |
); | |
$aggregate = []; | |
foreach ($meetupGroupUrlNames as $meetupGroupUrlName) { | |
$events = $client->getEvents(array( | |
'group_urlname' => $meetupGroupUrlName, | |
'status' => 'upcoming' | |
)); | |
foreach ($events->getData() as $event) { | |
$eventId = $event['time'] . '-' . $event['id']; | |
$eventData = [ | |
'name' => $event['name'], | |
'location' => $event['venue']['city'], | |
'group' => $event['group']['name'], | |
'time' => date('r', ($event['time'] / 1000)), | |
'url' => $event['event_url'], | |
]; | |
$aggregate[$eventId] = $eventData; | |
} | |
} | |
ksort($aggregate); | |
print_r($aggregate); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment