mirror of
https://git.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-26 22:01:29 +00:00
Compare commits
No commits in common. "679348d1f732d9f6928babf61e75398fd7d74a43" and "0f33427d5b5cfb92783dfecba63475da4116001c" have entirely different histories.
679348d1f7
...
0f33427d5b
|
@ -108,7 +108,6 @@ type MisskeyStatus struct {
|
||||||
|
|
||||||
type AccountMisskey struct {
|
type AccountMisskey struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Host string `json:"host"`
|
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
AvatarURL string `json:"avatarUrl"`
|
AvatarURL string `json:"avatarUrl"`
|
||||||
|
@ -273,17 +272,12 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
|
||||||
}
|
}
|
||||||
withFiles := "false"
|
withFiles := "false"
|
||||||
withReplies := "false"
|
withReplies := "false"
|
||||||
globalTimeline := false
|
|
||||||
for _, instanceParam := range instanceParams {
|
for _, instanceParam := range instanceParams {
|
||||||
switch instanceParam {
|
switch instanceParam {
|
||||||
case "withFiles":
|
case "withFiles":
|
||||||
withFiles = "true"
|
withFiles = "true"
|
||||||
params.Set("only_media", "true")
|
|
||||||
case "withReplies":
|
case "withReplies":
|
||||||
withReplies = "true"
|
withReplies = "true"
|
||||||
case "remote":
|
|
||||||
globalTimeline = true
|
|
||||||
params.Set(instanceParam, "true")
|
|
||||||
default:
|
default:
|
||||||
params.Set(instanceParam, "true")
|
params.Set(instanceParam, "true")
|
||||||
}
|
}
|
||||||
|
@ -294,11 +288,7 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
|
||||||
var bytesAttach []byte
|
var bytesAttach []byte
|
||||||
switch instance_type {
|
switch instance_type {
|
||||||
case "misskey":
|
case "misskey":
|
||||||
if globalTimeline {
|
|
||||||
perform.Path = "api/notes/global-timeline"
|
|
||||||
} else {
|
|
||||||
perform.Path = "api/notes/local-timeline"
|
perform.Path = "api/notes/local-timeline"
|
||||||
}
|
|
||||||
perform.RawQuery = ""
|
perform.RawQuery = ""
|
||||||
method = http.MethodPost
|
method = http.MethodPost
|
||||||
ContentType = "application/json"
|
ContentType = "application/json"
|
||||||
|
@ -345,11 +335,7 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
|
||||||
status.ID = statusMisskey.ID
|
status.ID = statusMisskey.ID
|
||||||
status.Account.ID = statusMisskey.User.ID
|
status.Account.ID = statusMisskey.User.ID
|
||||||
status.Account.DisplayName = statusMisskey.User.Name
|
status.Account.DisplayName = statusMisskey.User.Name
|
||||||
if statusMisskey.User.Host != "" {
|
|
||||||
status.Account.Acct = statusMisskey.User.Username + "@" + statusMisskey.User.Host
|
|
||||||
} else {
|
|
||||||
status.Account.Acct = statusMisskey.User.Username
|
status.Account.Acct = statusMisskey.User.Username
|
||||||
}
|
|
||||||
status.Account.Username = statusMisskey.User.Username
|
status.Account.Username = statusMisskey.User.Username
|
||||||
status.Account.Avatar = statusMisskey.User.AvatarURL
|
status.Account.Avatar = statusMisskey.User.AvatarURL
|
||||||
status.CreatedAt = statusMisskey.CreatedAt
|
status.CreatedAt = statusMisskey.CreatedAt
|
||||||
|
@ -385,14 +371,6 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
|
||||||
status.URL = "https://" + instance + "/notes/" + statusMisskey.ID
|
status.URL = "https://" + instance + "/notes/" + statusMisskey.ID
|
||||||
publicstatuses = append(publicstatuses, &status)
|
publicstatuses = append(publicstatuses, &status)
|
||||||
}
|
}
|
||||||
case "friendica":
|
|
||||||
err = json.NewDecoder(resp.Body).Decode(&publicstatuses)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
for _, status := range publicstatuses {
|
|
||||||
status.URL = status.URI // Fix federate URL
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
err = json.NewDecoder(resp.Body).Decode(&publicstatuses)
|
err = json.NewDecoder(resp.Body).Decode(&publicstatuses)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -26,14 +26,10 @@
|
||||||
<select id="instance_type" name="instance_type" title="Select instance type">
|
<select id="instance_type" name="instance_type" title="Select instance type">
|
||||||
<option value="mastodon-compatible" default>Mastodon compatible</option>
|
<option value="mastodon-compatible" default>Mastodon compatible</option>
|
||||||
<option value="misskey"{{if eq .InstanceType "misskey"}}selected{{end}}>Misskey</option>
|
<option value="misskey"{{if eq .InstanceType "misskey"}}selected{{end}}>Misskey</option>
|
||||||
<option value="friendica"{{if eq .InstanceType "friendica"}}selected{{end}}>Friendica</option>
|
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
<button type="submit"> Submit </button>
|
<button type="submit"> Submit </button>
|
||||||
</form>
|
</form>
|
||||||
{{if eq .Instance ""}}
|
|
||||||
<span>Possible params:<br>withFiles - show posts only with media<br>remote - try fetch their global timeline<br>You can combine params: withFile:remote:some_other_param</span>
|
|
||||||
{{end}}
|
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if eq .Type "tag"}}
|
{{if eq .Type "tag"}}
|
||||||
<form class="search-form" action="/timeline/tag" method="GET">
|
<form class="search-form" action="/timeline/tag" method="GET">
|
||||||
|
|
Loading…
Reference in a new issue