aboutsummaryrefslogtreecommitdiff
path: root/mastodon
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-26 19:18:09 +0000
committerr <r@freesoftwareextremist.com>2019-12-26 19:18:09 +0000
commit14bb18fbc7e6cdea57f27a44093d645d97bacb64 (patch)
tree79cde4763d978b30bc5aa404e7f761d9cada7a1d /mastodon
parent591360f2a8727e3b1f9e5f28ed3f6d983d6464b8 (diff)
downloadbloat-14bb18fbc7e6cdea57f27a44093d645d97bacb64.tar.gz
bloat-14bb18fbc7e6cdea57f27a44093d645d97bacb64.zip
Add search page
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/mastodon.go2
-rw-r--r--mastodon/status.go7
2 files changed, 6 insertions, 3 deletions
diff --git a/mastodon/mastodon.go b/mastodon/mastodon.go
index 8a8af6a..74fa0ff 100644
--- a/mastodon/mastodon.go
+++ b/mastodon/mastodon.go
@@ -336,7 +336,7 @@ type Emoji struct {
type Results struct {
Accounts []*Account `json:"accounts"`
Statuses []*Status `json:"statuses"`
- Hashtags []string `json:"hashtags"`
+ // Hashtags []string `json:"hashtags"`
}
// Pagination is a struct for specifying the get range.
diff --git a/mastodon/status.go b/mastodon/status.go
index edd88e9..816d092 100644
--- a/mastodon/status.go
+++ b/mastodon/status.go
@@ -284,12 +284,15 @@ func (c *Client) DeleteStatus(ctx context.Context, id string) error {
}
// Search search content with query.
-func (c *Client) Search(ctx context.Context, q string, resolve bool) (*Results, error) {
+func (c *Client) Search(ctx context.Context, q string, qType string, limit int, resolve bool, offset int) (*Results, error) {
params := url.Values{}
params.Set("q", q)
+ params.Set("type", qType)
+ params.Set("limit", fmt.Sprint(limit))
params.Set("resolve", fmt.Sprint(resolve))
+ params.Set("offset", fmt.Sprint(offset))
var results Results
- err := c.doAPI(ctx, http.MethodGet, "/api/v1/search", params, &results, nil)
+ err := c.doAPI(ctx, http.MethodGet, "/api/v2/search", params, &results, nil)
if err != nil {
return nil, err
}