Beispiel #1
0
try {
    $posts = WaPost::FindPostByWall($wall, $totalLimit);
    if (!$posts) {
        throw new Exception('暂无新帖。');
    }
} catch (Exception $e) {
    returnError($e->getMessage());
    return;
}
for ($i = 0; $i < $offset; $i++) {
    next($posts);
}
while (list($key, $post) = each($posts)) {
    $post_id = $post['post_id'];
    try {
        $postInfo = WaPost::GetPostInfo($post_id);
        if (!$postInfo) {
            throw new Exception('');
        }
    } catch (Exception $e) {
        continue;
    }
    $post = array();
    $post['post_id'] = $postInfo['post_id'];
    $post['post_title'] = $postInfo['post_title'];
    $post['post_content'] = $postInfo['post_content'];
    $creator = $postInfo['post_creator'];
    try {
        $creator_info = WaUser::GetUserInfo($creator);
    } catch (Exception $e) {
        continue;