summaryrefslogtreecommitdiff
path: root/lib/twitterapi.php
diff options
context:
space:
mode:
authorzach <zach@controlyourself.ca>2008-09-30 17:25:26 -0400
committerzach <zach@controlyourself.ca>2008-09-30 17:25:26 -0400
commit1c4f7722da90e8e8ce0489720ede223804885377 (patch)
tree1e44670e7b384f82fe808158e4865c9fc5228d58 /lib/twitterapi.php
parent37b3bd54893b0221fba32461c2720fc252e11743 (diff)
Twitter-compatible API - factored out redundant JSON printing functions
darcs-hash:20080930212526-462f3-abe9f1f2fc395c751b2861e686d638ea0a8ca001.gz
Diffstat (limited to 'lib/twitterapi.php')
-rw-r--r--lib/twitterapi.php18
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index 98d094cfe..d6ec1e9a0 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -185,16 +185,8 @@ class TwitterapiAction extends Action {
common_element_end('entry');
}
- function show_twitter_json_statuses($twitter_statuses) {
- print(json_encode($twitter_statuses));
- }
-
- function show_twitter_json_users($twitter_users) {
- print(json_encode($twitter_users));
- }
-
- function show_twitter_json_dmsgs($twitter_dms) {
- print(json_encode($twitter_dms));
+ function show_json_objects($objects) {
+ print(json_encode($objects));
}
function show_single_xml_status($notice) {
@@ -208,7 +200,7 @@ class TwitterapiAction extends Action {
function show_single_json_status($notice) {
$this->init_document('json');
$status = $this->twitter_status_array($notice);
- $this->show_twitter_json_statuses($status);
+ $this->show_json_objects($status);
$this->end_document('json');
exit();
}
@@ -331,7 +323,7 @@ class TwitterapiAction extends Action {
}
}
- $this->show_twitter_json_statuses($statuses);
+ $this->show_json_objects($statuses);
$this->end_document('json');
}
@@ -507,7 +499,7 @@ class TwitterapiAction extends Action {
$this->show_twitter_xml_user($profile_array);
break;
case 'json':
- $this->show_twitter_json_users($profile_array);
+ $this->show_json_objects($profile_array);
break;
default:
$this->client_error(_('Not a supported data format.'));