add previous button

This commit is contained in:
orangix
2024-02-06 01:41:28 +01:00
parent 337796b9be
commit 0171d76fae
4 changed files with 47 additions and 5 deletions

View File

@@ -72,7 +72,8 @@ func (client *Client) FetchTag(tag string, sort string, page string) (Tag, error
func(key, value gjson.Result) bool {
url, _ := url.Parse(strings.ReplaceAll(value.Get("url").String(), "https://imgur.com", ""))
q := url.Query()
q.Add("tag", tag+"."+sort+"."+page+"."+key.String())
ts := tag + "." + sort + "." + page + "." + key.String()
q.Add("tag", ts)
url.RawQuery = q.Encode()
posts = append(posts, Submission{
@@ -90,6 +91,8 @@ func (client *Client) FetchTag(tag string, sort string, page string) (Tag, error
Comments: value.Get("comment_count").Int(),
Views: value.Get("view_count").Int(),
IsAlbum: value.Get("is_album").Bool(),
tagstring: ts,
})
return true

View File

@@ -33,6 +33,8 @@ type Submission struct {
Comments int64
Views int64
IsAlbum bool
tagstring string
}
func (client *Client) FetchUser(username string) (User, error) {