diff options
author | Brion Vibber <brion@pobox.com> | 2010-09-21 18:15:32 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-09-28 07:44:22 -0700 |
commit | 1685c8a4fa0c5e2eab514b5eea23ddc963255cbb (patch) | |
tree | 1ce80838167dbf210e78c5308cb7773eca606b2d /plugins/YammerImport/yamdump.php | |
parent | 37c67c3f9ff7af942c3fa629724589e4de31f94e (diff) |
Fetch more user data in Yammer imports, including the primary email address (preconfirmed, so we can do stuff like tell people to reset their passwords and log in!) and some bio info.
Diffstat (limited to 'plugins/YammerImport/yamdump.php')
-rw-r--r-- | plugins/YammerImport/yamdump.php | 48 |
1 files changed, 10 insertions, 38 deletions
diff --git a/plugins/YammerImport/yamdump.php b/plugins/YammerImport/yamdump.php index ef3927598..809baa122 100644 --- a/plugins/YammerImport/yamdump.php +++ b/plugins/YammerImport/yamdump.php @@ -13,50 +13,22 @@ require 'yam-config.php'; $yam = new SN_YammerClient($consumerKey, $consumerSecret, $token, $tokenSecret); $imp = new YammerImporter($yam); -$data = $yam->messages(); +$data = $yam->users(); var_dump($data); - -/* - ["messages"]=> - ["meta"]=> // followed_user_ids, current_user_id, etc - ["threaded_extended"]=> // empty! - ["references"]=> // lists the users, threads, replied messages, tags -*/ - -// 1) we're getting messages in descending order, but we'll want to process ascending -// 2) we'll need to pull out all those referenced items too? -// 3) do we need to page over or anything? - -// 20 qualifying messages per hit... -// use older_than to grab more -// (better if we can go in reverse though!) -// meta: The older-available element indicates whether messages older than those shown are available to be fetched. See the older_than parameter mentioned above. - -foreach ($data['references'] as $item) { - if ($item['type'] == 'user') { - $user = $imp->prepUser($item); - var_dump($user); - } else if ($item['type'] == 'group') { - $group = $imp->prepGroup($item); - var_dump($group); - } else if ($item['type'] == 'tag') { - // could need these if we work from the parsed message text - // otherwise, the #blarf in orig text is fine. - } else if ($item['type'] == 'thread') { - // Shouldn't need thread info; we'll reconstruct conversations - // from the reply-to chains. - } else if ($item['type'] == 'message') { - // If we're processing everything, then we don't need the refs here. - } else { - echo "(skipping unknown ref: " . $item['type'] . ")\n"; - } +// @fixme follow paging +foreach ($data as $item) { + $user = $imp->prepUser($item); + var_dump($user); } -// Process in reverse chron order... +/* +$data = $yam->messages(); +var_dump($data); // @fixme follow paging $messages = $data['messages']; -array_reverse($messages); +$messages = array_reverse($messages); foreach ($messages as $message) { $notice = $imp->prepNotice($message); var_dump($notice); } +*/ |