use Friendica\Database\DBStructure;
use Friendica\DI;
use Friendica\Model\Item;
+use Friendica\Model\Post;
use Friendica\Module\BaseSettings;
/**
// write the table header (like Mastodon)
echo "Account address, Show boosts\n";
// get all the contacts
- $contacts = DBA::select('contact', ['addr'], ['uid' => $_SESSION['uid'], 'self' => false, 'rel' => [1,3], 'deleted' => false]);
+ $contacts = DBA::select('contact', ['addr', 'url'], ['uid' => $_SESSION['uid'], 'self' => false, 'rel' => [1,3], 'deleted' => false]);
while ($contact = DBA::fetch($contacts)) {
- echo $contact['addr'] . ", true\n";
+ echo ($contact['addr'] ?: $contact['url']) . ", true\n";
}
DBA::close($contacts);
}
self::exportAccount($a);
echo "\n";
- $total = DBA::count('item', ['uid' => local_user()]);
+ $total = Post::count(['uid' => local_user()]);
// chunk the output to avoid exhausting memory
for ($x = 0; $x < $total; $x += 500) {
- $items = Item::selectToArray(Item::ITEM_FIELDLIST, ['uid' => local_user()], ['limit' => [$x, 500]]);
+ $items = Post::selectToArray(Item::ITEM_FIELDLIST, ['uid' => local_user()], ['limit' => [$x, 500]]);
$output = ['item' => $items];
echo json_encode($output, JSON_PARTIAL_OUTPUT_ON_ERROR). "\n";
}