diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-07-15 10:37:50 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-07-15 10:37:50 -0400 |
commit | 75545cdc07db0e12a351ed0f519675626dd2e7bd (patch) | |
tree | 1a0be14c026e7345e30ad41f67a05b7d07c90ccc | |
parent | b05b998d68ab2d4802ed4ec96abec59332ffe354 (diff) |
Added attachment information to the json responses
-rw-r--r-- | lib/twitterapi.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/twitterapi.php b/lib/twitterapi.php index 655b6c777..749083c7c 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -186,6 +186,21 @@ class TwitterapiAction extends Action $twitter_status['favorited'] = false; } + # Enclosures + $attachments = $notice->attachments(); + $twitter_status['attachments']=array(); + if($attachments){ + foreach($attachments as $attachment){ + if ($attachment->isEnclosure()) { + $enclosure=array(); + $enclosure['url']=$attachment->url; + $enclosure['mimetype']=$attachment->mimetype; + $enclosure['size']=$attachment->size; + $twitter_status['attachments'][]=$enclosure; + } + } + } + if ($include_user) { # Don't get notice (recursive!) $twitter_user = $this->twitter_user_array($profile, false); |