mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-22 23:13:00 +00:00
true remote timeline fixed
This commit is contained in:
parent
34940a65df
commit
eedd9d2c5c
1
README
1
README
@ -9,6 +9,7 @@ Changes (localhost_custom fork):
|
||||
- Is personal fork, no recommended for public use (use as local frontend)
|
||||
- Add reactions for pleroma (includes custom emojis input)
|
||||
- tag timeline
|
||||
- true remote timeline
|
||||
- visible edited post time
|
||||
- visible quoted post (status in status)
|
||||
- visible profile banner in spoiler
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -163,6 +163,10 @@ func (s *service) TimelinePage(c *client, tType, instance, listId, maxID,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
v := make(url.Values)
|
||||
v.Set("max_id", statuses[len(statuses)-1].ID)
|
||||
v.Set("instance", instance)
|
||||
nextLink = "/timeline/" + tType + "?" + v.Encode()
|
||||
}
|
||||
title = "True Remote Timeline"
|
||||
case "twkn":
|
||||
@ -207,6 +211,10 @@ func (s *service) TimelinePage(c *client, tType, instance, listId, maxID,
|
||||
}
|
||||
statuses[i].Pleroma.Reactions = reactions
|
||||
}
|
||||
if tType == "tremote" {
|
||||
statuses[i].URL = fmt.Sprintf("/search?q=%s&type=statuses", statuses[i].URL)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (len(maxID) > 0 || len(minID) > 0) && len(statuses) > 0 {
|
||||
|
@ -227,6 +227,11 @@
|
||||
</form>
|
||||
{{end}}
|
||||
<div class="status-action-container">
|
||||
{{if eq (printf "%.7s" .URL) "/search"}}
|
||||
<div class="status-action">
|
||||
<a href="{{.URL}}">Federate!</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="status-action">
|
||||
<a href="/thread/{{.ID}}?reply=true#status-{{.ID}}">
|
||||
reply
|
||||
@ -237,6 +242,7 @@
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="status-action">
|
||||
{{$rt := "retweet"}} {{if .Reblogged}} {{$rt = "unretweet"}} {{end}}
|
||||
<form class="status-retweet" data-action="{{$rt}}" action="/{{$rt}}/{{.ID}}" method="post" target="_self">
|
||||
|
@ -13,6 +13,10 @@
|
||||
</span>
|
||||
<button type="submit"> Submit </button>
|
||||
</form>
|
||||
{{if eq .Instance ""}}
|
||||
{{else}}
|
||||
<a href="/timeline/tremote?instance={{.Instance}}"> Look via True remote timeline viewer (works with mastodon API compatible instances) </a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if eq .Type "tag"}}
|
||||
<form class="search-form" action="/timeline/tag" method="GET">
|
||||
|
Loading…
Reference in New Issue
Block a user