2010-04-20 17:49:07 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if (php_sapi_name() != 'cli') {
|
|
|
|
die('no');
|
|
|
|
}
|
|
|
|
|
2010-09-22 20:52:34 +01:00
|
|
|
define('INSTALLDIR', dirname(dirname(dirname(dirname(__FILE__)))));
|
2010-04-20 17:49:07 +01:00
|
|
|
|
|
|
|
require INSTALLDIR . "/scripts/commandline.inc";
|
|
|
|
|
|
|
|
// temp stuff
|
|
|
|
require 'yam-config.php';
|
|
|
|
$yam = new SN_YammerClient($consumerKey, $consumerSecret, $token, $tokenSecret);
|
2010-09-22 01:08:40 +01:00
|
|
|
$imp = new YammerImporter($yam);
|
2010-09-21 21:56:30 +01:00
|
|
|
|
2010-09-22 02:15:32 +01:00
|
|
|
$data = $yam->users();
|
2010-09-22 00:27:10 +01:00
|
|
|
var_dump($data);
|
2010-09-22 02:15:32 +01:00
|
|
|
// @fixme follow paging
|
|
|
|
foreach ($data as $item) {
|
|
|
|
$user = $imp->prepUser($item);
|
|
|
|
var_dump($user);
|
2010-09-21 22:56:20 +01:00
|
|
|
}
|
|
|
|
|
2010-09-22 02:15:32 +01:00
|
|
|
/*
|
|
|
|
$data = $yam->messages();
|
|
|
|
var_dump($data);
|
2010-09-21 22:56:20 +01:00
|
|
|
// @fixme follow paging
|
|
|
|
$messages = $data['messages'];
|
2010-09-22 02:15:32 +01:00
|
|
|
$messages = array_reverse($messages);
|
2010-09-21 22:56:20 +01:00
|
|
|
foreach ($messages as $message) {
|
|
|
|
$notice = $imp->prepNotice($message);
|
2010-09-21 21:56:30 +01:00
|
|
|
var_dump($notice);
|
|
|
|
}
|
2010-09-22 02:15:32 +01:00
|
|
|
*/
|