-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
33 lines (28 loc) · 932 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
use DMS\Service\Meetup\MeetupKeyAuthClient;
use Dotenv\Dotenv;
require 'vendor/autoload.php';
if(file_exists('.env')) {
$dotenv = new Dotenv(__DIR__);
$dotenv->load();
}
$client = MeetupKeyAuthClient::factory(array('key' => getenv('MEETUP_API_KEY')));
$command = $client->getCommand('GetGroupEventsAttendance', [
'id' => '250485750',
'urlname' => 'PHP-Rio'
]);
$command->prepare();
$response = $command->execute();
// print_r($response);
// $dbopts = parse_url(getenv('DATABASE_URL'));
// $database=ltrim($dbopts['path'],'/');
// $dsn = "mysql:dbname=$database;host={$dbopts['host']}";
// $pdo=new PDO($dsn, $dbopts['user'],$dbopts['pass']);
// $result=$pdo->query('desc user');
// foreach($result as $row){
// print_r($row);
// }
foreach ($response->getData() as $user) {
$query ="INSERT into user (id,nome) values ({$user['member']['id']}, '{$user['member']['name']}')\n";
print_r($query);
}