diff options
Diffstat (limited to 'include/api_zot.php')
-rw-r--r-- | include/api_zot.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/api_zot.php b/include/api_zot.php index 6a5b9a268..b332aea71 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(date_default_timezone_get(),'UTC', $_REQUEST['since']); + } + $finish = datetime_convert(date_default_timezone_get(),'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) { |