Ejemplo n.º 1
0
        if (!$quiet) {
            echo "Couldn't find any existing OStatus profiles.\n";
        }
    }
    exit(0);
}
while ($lop->fetch()) {
    if (!$quiet) {
        echo "Updating OStatus profile '{$lop->uri}' ... ";
    }
    try {
        $oprofile = pullOstatusProfile($lop->uri);
        if (!empty($oprofile)) {
            $orig = clone $lop;
            $lop->avatar = $oprofile->avatar;
            $lop->update($orig);
            $lop->updateAvatar($oprofile->avatar);
            if (!$quiet) {
                print "Done.\n";
            }
        }
    } catch (Exception $e) {
        if (!$quiet) {
            print $e->getMessage() . "\n";
        }
        common_log(LOG_WARN, $e->getMessage(), __FILE__);
        // continue on error
    }
}
if (!$quiet) {
    echo "OK.\n";