aboutsummaryrefslogtreecommitdiffstats
path: root/include/api_zot.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-02-24 14:46:09 -0800
committerzotlabs <mike@macgirvin.com>2019-02-24 14:46:09 -0800
commit20e43311db8f320ac6eeb094c27210885637240d (patch)
treed1c105fb37cea8eb149041012c96ee9e1e633b50 /include/api_zot.php
parenta77d7b844240030a764455b78b1b13fc886322f5 (diff)
downloadvolse-hubzilla-20e43311db8f320ac6eeb094c27210885637240d.tar.gz
volse-hubzilla-20e43311db8f320ac6eeb094c27210885637240d.tar.bz2
volse-hubzilla-20e43311db8f320ac6eeb094c27210885637240d.zip
zot api changes to support combined content (items+files) import addon
Diffstat (limited to 'include/api_zot.php')
-rw-r--r--include/api_zot.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/api_zot.php b/include/api_zot.php
index 6a5b9a268..d2cadc9a4 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -6,6 +6,8 @@
api_register_func('api/export/basic','api_export_basic', true);
api_register_func('api/red/channel/export/basic','api_export_basic', true);
api_register_func('api/z/1.0/channel/export/basic','api_export_basic', true);
+ api_register_func('api/red/item/export/page','api_item_export_page', true);
+ api_register_func('api/z/1.0/item/export/page','api_item_export_page', true);
api_register_func('api/red/channel/list','api_channel_list', true);
api_register_func('api/z/1.0/channel/list','api_channel_list', true);
api_register_func('api/red/channel/stream','api_channel_stream', true);
@@ -80,6 +82,26 @@
json_return_and_die(identity_basic_export(api_user(),$sections));
}
+ function api_item_export_page($type) {
+ if(api_user() === false) {
+ logger('api_item_export_page: no user');
+ return false;
+ }
+ $page = intval($_REQUEST['page']);
+ $records = intval($_REQUEST['records']);
+ if(! $records) {
+ $records = 50;
+ }
+ if(! $_REQUEST['since'])
+ $start = NULL_DATE;
+ else {
+ $start = datetime_convert('UTC','UTC', $_REQUEST['since']);
+ }
+ $finish = datetime_convert('UTC','UTC', (($_REQUEST['until']) ? $_REQUEST['until'] : 'now'));
+
+ json_return_and_die(channel_export_items_page(api_user(),$start,$finish,$page,$records));
+ }
+
function api_network_stream($type) {
if(api_user() === false) {