aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-20 17:16:13 -0700
committerFriendika <info@friendika.com>2011-06-20 17:16:13 -0700
commitdb336929cd1211e6704914c77dc332d7555decff (patch)
treecd7bfa50e6b4558d15d703e4e930baad8af00d2b /include/api.php
parent285d617569f525b213318bcb2eadcbb34400e4f3 (diff)
downloadvolse-hubzilla-db336929cd1211e6704914c77dc332d7555decff.tar.gz
volse-hubzilla-db336929cd1211e6704914c77dc332d7555decff.tar.bz2
volse-hubzilla-db336929cd1211e6704914c77dc332d7555decff.zip
add rate limit call so spaz will work
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/api.php b/include/api.php
index 43a77bcc7..2d9007126 100644
--- a/include/api.php
+++ b/include/api.php
@@ -129,7 +129,8 @@
break;
case "json":
header ("Content-Type: application/json");
- return json_encode($r);
+ foreach($r as $rr)
+ return json_encode($rr);
break;
case "rss":
header ("Content-Type: application/rss+xml");
@@ -279,6 +280,7 @@
* load api $templatename for $type and replace $data array
*/
function api_apply_template($templatename, $type, $data){
+
switch($type){
case "rss":
case "atom":
@@ -526,3 +528,17 @@
api_register_func('api/statuses/user_timeline','api_statuses_home_timeline', true);
# TODO: user_timeline should be profile view
+
+ function api_account_rate_limit_status(&$a,$type) {
+
+ $hash = array(
+ 'remaining_hits' => (string) 150,
+ 'hourly_limit' => (string) 150,
+ 'reset_time' => datetime_convert('UTC','UTC','now + 1 hour',ATOM_TIME),
+ 'reset_time_in_seconds' => strtotime('now + 1 hour')
+ );
+
+ return api_apply_template('ratelimit', $type, array('$hash' => $hash));
+
+ }
+ api_register_func('api/account/rate_limit_status','api_account_rate_limit_status',true);