diff options
author | zotlabs <mike@macgirvin.com> | 2017-04-26 13:26:50 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-04-26 20:14:45 -0700 |
commit | ac670856f67d5ff2b6a61e76103e331039dbf6b1 (patch) | |
tree | 463fb19e258cb6fefb2fc1507b2040d27488c379 /Zotlabs/Module/Ofeed.php | |
parent | 88149f56bb2d2fb8f4a02cc320e5ba83435d8acc (diff) | |
download | volse-hubzilla-ac670856f67d5ff2b6a61e76103e331039dbf6b1.tar.gz volse-hubzilla-ac670856f67d5ff2b6a61e76103e331039dbf6b1.tar.bz2 volse-hubzilla-ac670856f67d5ff2b6a61e76103e331039dbf6b1.zip |
provide a broken feed as a separate module
Diffstat (limited to 'Zotlabs/Module/Ofeed.php')
-rw-r--r-- | Zotlabs/Module/Ofeed.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Zotlabs/Module/Ofeed.php b/Zotlabs/Module/Ofeed.php new file mode 100644 index 000000000..2b7acff99 --- /dev/null +++ b/Zotlabs/Module/Ofeed.php @@ -0,0 +1,48 @@ +<?php + +namespace Zotlabs\Module; + +/* Ofeed: Broken feed for software which requires broken feeds */ + +require_once('include/items.php'); + +class Ofeed extends \Zotlabs\Web\Controller { + + function init() { + + $params = []; + + $params['begin'] = ((x($_REQUEST,'date_begin')) ? $_REQUEST['date_begin'] : NULL_DATE); + $params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : ''); + $params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml'); + $params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0); + $params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0); + $params['start'] = ((x($params,'start')) ? intval($params['start']) : 0); + $params['records'] = ((x($params,'records')) ? intval($params['records']) : 40); + $params['direction'] = ((x($params,'direction')) ? dbesc($params['direction']) : 'desc'); + $params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : ''); + $params['compat'] = ((x($_REQUEST,'compat')) ? intval($_REQUEST['compat']) : 1); + + + if(argc() > 1) { + + if(observer_prohibited(true)) { + killme(); + } + + $channel = channelx_by_nick(argv(1)); + if(! $channel) { + killme(); + } + + + logger('public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['channel_address']); + + echo get_public_feed($channel,$params); + + killme(); + } + + } + +} |