Use searcher/options to get user posts/comments

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-05-18 23:11:47 -04:00
parent 7b83e8366a
commit 946318c27b
3 changed files with 319 additions and 159 deletions
+1 -3
View File
@@ -306,8 +306,6 @@ func CheckResponse(r *http.Response) error {
// ListOptions are the optional parameters to the various endpoints that return lists
type ListOptions struct {
Type string `url:"type,omitempty"` // links or comments
// For getting submissions
// all, year, month, week, day, hour
Timespan string `url:"t,omitempty"`
@@ -315,7 +313,7 @@ type ListOptions struct {
// Common for all listing endpoints
After string `url:"after,omitempty"`
Before string `url:"before,omitempty"`
Limit int `url:"limit,omitempty"` // default: 25
Limit int `url:"limit,omitempty"` // default: 25, max: 100
}
func addOptions(s string, opt interface{}) (string, error) {