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