Add list timeline support.
This commit is contained in:
parent
3e2bdc63c7
commit
9427a55316
|
@ -125,6 +125,7 @@ func main() {
|
||||||
* [x] GET /api/v1/timelines/home
|
* [x] GET /api/v1/timelines/home
|
||||||
* [x] GET /api/v1/timelines/public
|
* [x] GET /api/v1/timelines/public
|
||||||
* [x] GET /api/v1/timelines/tag/:hashtag
|
* [x] GET /api/v1/timelines/tag/:hashtag
|
||||||
|
* [x] GET /api/v1/timelines/list/:id
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|
12
status.go
12
status.go
|
@ -3,10 +3,10 @@ package mastodon
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
"io"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Status is struct to hold status.
|
// Status is struct to hold status.
|
||||||
|
@ -201,6 +201,16 @@ func (c *Client) GetTimelineHashtag(ctx context.Context, tag string, isLocal boo
|
||||||
return statuses, nil
|
return statuses, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetTimelineList return statuses from a list timeline.
|
||||||
|
func (c *Client) GetTimelineList(ctx context.Context, id ID, pg *Pagination) ([]*Status, error) {
|
||||||
|
var statuses []*Status
|
||||||
|
err := c.doAPI(ctx, http.MethodGet, fmt.Sprintf("/api/v1/timelines/list/%s", url.PathEscape(string(id))), nil, &statuses, pg)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return statuses, nil
|
||||||
|
}
|
||||||
|
|
||||||
// GetTimelineMedia return statuses from media timeline.
|
// GetTimelineMedia return statuses from media timeline.
|
||||||
// NOTE: This is an experimental feature of pawoo.net.
|
// NOTE: This is an experimental feature of pawoo.net.
|
||||||
func (c *Client) GetTimelineMedia(ctx context.Context, isLocal bool, pg *Pagination) ([]*Status, error) {
|
func (c *Client) GetTimelineMedia(ctx context.Context, isLocal bool, pg *Pagination) ([]*Status, error) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user