blob: 8bdb21c6d196ca84c42988b64be994750bd7612a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package client
import (
"dborg/internal/models"
"encoding/json"
"fmt"
"net/url"
)
func (c *Client) SearchTwitterHistory(username string) (*models.XResponse, error) {
path := fmt.Sprintf("/x/search/%s", url.PathEscape(username))
data, err := c.Get(path, nil)
if err != nil {
return nil, err
}
var response models.XResponse
if err := json.Unmarshal(data, &response); err != nil {
return nil, fmt.Errorf("failed to parse Twitter/X response: %w", err)
}
return &response, nil
}
|