From 8a1347fad6f30a97eea7e2ed59947eea6ca05d0b Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Sun, 16 Apr 2017 21:42:54 +0900 Subject: [PATCH] add GetAccountStatuses --- README.md | 2 +- accounts.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d31b2a5..a28adca 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ if err != nil { * [x] PATCH /api/v1/accounts/update_credentials * [x] GET /api/v1/accounts/:id/followers * [x] GET /api/v1/accounts/:id/following -* [ ] GET /api/v1/accounts/:id/statuses +* [x] GET /api/v1/accounts/:id/statuses * [x] POST /api/v1/accounts/:id/follow * [x] POST /api/v1/accounts/:id/unfollow * [x] GET /api/v1/accounts/:id/block diff --git a/accounts.go b/accounts.go index fa94a1f..0dd7fa3 100644 --- a/accounts.go +++ b/accounts.go @@ -82,6 +82,16 @@ func (c *Client) AccountUpdate(profile *Profile) (*Account, error) { return &account, nil } +// GetAccountStatuses return statuses by specified accuont. +func (c *Client) GetAccountStatuses(id int64) ([]*Status, error) { + var statuses []*Status + err := c.doAPI(http.MethodGet, fmt.Sprintf("/api/v1/accounts/%d/statuses", id), nil, &statuses) + if err != nil { + return nil, err + } + return statuses, nil +} + // GetAccountFollowers return followers list. func (c *Client) GetAccountFollowers(id int64) ([]*Account, error) { var accounts []*Account