gnu-social/plugins/YammerImport/scripts/yamdump.php

35 lines
748 B
PHP
Raw Normal View History

2010-04-21 01:49:07 +09:00
<?php
if (php_sapi_name() != 'cli') {
die('no');
}
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);
$imp = new YammerImporter($yam);
2010-09-24 04:52:58 +09:00
/*
$data = $yam->users();
var_dump($data);
// @fixme follow paging
foreach ($data as $item) {
$user = $imp->prepUser($item);
var_dump($user);
}
2010-09-24 04:52:58 +09:00
*/
2010-09-24 04:52:58 +09:00
$data = $yam->messages(array('newer_than' => 1));
var_dump($data);
// @fixme follow paging
$messages = $data['messages'];
$messages = array_reverse($messages);
foreach ($messages as $message) {
$notice = $imp->prepNotice($message);
var_dump($notice);
}