add GetTimelineHashtag

pull/13/head
Yasuhiro Matsumoto 2017-04-15 21:02:55 +09:00
parent fdcc642234
commit 564554c1c9
2 changed files with 11 additions and 1 deletions

View File

@ -66,7 +66,7 @@ if err != nil {
* [ ] POST /api/v1/statuses/:id/unfavourite
* [x] GET /api/v1/timelines/home
* [x] GET /api/v1/timelines/public
* [ ] GET /api/v1/timelines/tag/:hashtag
* [x] GET /api/v1/timelines/tag/:hashtag
## Installation

View File

@ -95,6 +95,16 @@ func (c *Client) GetTimelineHome() ([]*Status, error) {
return statuses, nil
}
// GetTimelineHashtag return statuses from tagged timeline.
func (c *Client) GetTimelineHashtag(tag string) ([]*Status, error) {
var statuses []*Status
err := c.doAPI(http.MethodGet, fmt.Sprintf("/api/v1/timelines/tag/%s", (&url.URL{Path: tag}).EscapedPath()), nil, &statuses)
if err != nil {
return nil, err
}
return statuses, nil
}
// PostStatus post the toot.
func (c *Client) PostStatus(toot *Toot) (*Status, error) {
params := url.Values{}