- /*
- * http://developer.twitter.com/doc/get/statuses/user_timeline
- */
- function api_statuses_user_timeline(&$a){
-
- $user_info = api_get_user($a);
-
- // get last public wall message
- $lastwall = q("SELECT `item`.*, `item`.`id` AS `item_id`,
- `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
- `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
- `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
- FROM `item`, `contact`, `user`
- WHERE `item`.`uid` = %d AND `user`.`uid` = `item`.`uid`
- AND `item`.`visible` = 1 AND `item`.`deleted` = 0
- AND `contact`.`id` = `item`.`contact-id`
- AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
-
- AND `item`.`type`='wall'
- AND `item`.`allow_cid`='' AND `item`.`allow_gid`='' AND `item`.`deny_cid`='' AND `item`.`deny_gid`=''
-
- ORDER BY `item`.`created` DESC LIMIT %d ,%d ",
- intval($user_info['id']),
- 0, 20
- );
-
-
- $ret = new Container("statuses");
- $ret->attrs['type']='array';
-
- foreach($lastwall as $item) {
- $status = new Container('status', array(
- 'created_at'=> api_date($item['created']),
- 'id' => $item['id'],
- 'text' => strip_tags(bbcode($item['body'])),
- 'source' => 'web', #XXX: Fix me!
- 'truncated' => False,
- 'in_reply_to_status_id' => '',
- 'in_reply_to_user_id' => '',
- 'favorited' => false,
- 'in_reply_to_screen_name' => '',
- 'geo' => '',
- 'coordinates' => $item['coord'],
- 'place' => $item['location'],
- 'contributors' => '',
- 'annotations' => '',
- 'entities' => '',
- 'user' => $user_info
- ));
- $ret[]=$status;
- };
-
- return $ret;
- }
- api_register_func('api/statuses/user_timeline','api_statuses_user_timeline', true);
-
\ No newline at end of file