mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-10 13:58:46 +00:00
true remote timeline fixed
This commit is contained in:
parent
34940a65df
commit
eedd9d2c5c
5 changed files with 29 additions and 11 deletions
|
@ -11,8 +11,6 @@ import (
|
|||
"path/filepath"
|
||||
"time"
|
||||
"encoding/json"
|
||||
"path"
|
||||
"strings"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
|
@ -244,21 +242,22 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, pg *Pa
|
|||
if pg != nil {
|
||||
params = pg.setValues(params)
|
||||
}
|
||||
u, err := url.Parse("https://" + instance)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
u.Path = path.Join(u.Path, "/api/v1/timelines/public")
|
||||
|
||||
req, err := http.NewRequest(http.MethodGet, u.String(), strings.NewReader(params.Encode()))
|
||||
perform := url.URL{
|
||||
Scheme: "https",
|
||||
Host: instance,
|
||||
Path: "api/v1/timelines/public",
|
||||
RawQuery: params.Encode(),
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(http.MethodGet, perform.String(), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
req.Header.Set("User-Agent", "Bloat")
|
||||
resp, err := httpclient.Do(req)
|
||||
fmt.Println(req)
|
||||
fmt.Println(resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -269,10 +268,10 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, pg *Pa
|
|||
}
|
||||
|
||||
err = json.NewDecoder(resp.Body).Decode(&publicstatuses)
|
||||
fmt.Println(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return publicstatuses, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue