Example #1
0
$errorsReported = false;
$dataType = "application/json";
$mngr = new rRSSManager();
switch ($cmd) {
    case "setinterval":
        $mngr->setInterval($_REQUEST['interval']);
    case "getintervals":
        $val = $mngr->getIntervals();
        break;
    case "add":
        $lbl = null;
        if (isset($_REQUEST['label'])) {
            $lbl = $_REQUEST['label'];
        }
        if (isset($_REQUEST['url'])) {
            $mngr->add($_REQUEST['url'], $lbl);
        }
        break;
    case "addgroup":
        $lbl = "RSS Group";
        if (isset($_REQUEST['label']) && $_REQUEST['label'] != "") {
            $lbl = $_REQUEST['label'];
        }
        if (!isset($HTTP_RAW_POST_DATA)) {
            $HTTP_RAW_POST_DATA = file_get_contents("php://input");
        }
        $rssList = array();
        if (isset($HTTP_RAW_POST_DATA)) {
            $vars = explode('&', $HTTP_RAW_POST_DATA);
            foreach ($vars as $var) {
                $parts = explode("=", $var);