diff options
author | Andrew Dolgov <[email protected]> | 2010-11-25 13:20:37 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-11-25 13:23:37 +0300 |
commit | 563b9c782d0cfbcebd7686cd2fce202d874ec9df (patch) | |
tree | 23853655de85a27f44c9cc56729c554eb2bc7637 /modules/backend-rpc.php | |
parent | ba7e88e5a59295ac3eed38ea627e9fa2a414b989 (diff) |
remove xml from getAllCounters rpc call, use pure JSON
Diffstat (limited to 'modules/backend-rpc.php')
-rw-r--r-- | modules/backend-rpc.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index e93571207..93d8f074b 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -282,29 +282,27 @@ if ($subop == "updateAllFeeds" || $subop == "getAllCounters") { + header("Content-Type: text/plain"); + $last_article_id = (int) $_REQUEST["last_article_id"]; - print "<rpc-reply>"; + $reply = array(); - if ($seq) - print "<seq>$seq</seq>"; + if ($seq) $reply['seq'] = $seq; if ($last_article_id != getLastArticleId($link)) { - print "<counters><![CDATA["; $omode = $_REQUEST["omode"]; if ($omode != "T") - print json_encode(getAllCounters($link, $omode)); + $reply['counters'] = getAllCounters($link, $omode); else - print json_encode(getGlobalCounters($link)); - - print "]]></counters>"; + $reply['counters'] = getGlobalCounters($link); } - print_runtime_info($link); + $reply['runtime-info'] = make_runtime_info($link); - print "</rpc-reply>"; + print json_encode($reply); return; } @@ -983,7 +981,7 @@ } if ($subop == "getTweetInfo") { - header("Content-Type: text/html"); + header("Content-Type: text/plain"); $id = db_escape_string($_REQUEST['id']); $result = db_query($link, "SELECT title, link |