diff --git a/drivel.go b/drivel.go index 30e486a..ed6aeb9 100644 --- a/drivel.go +++ b/drivel.go @@ -308,7 +308,7 @@ func timelineLoop(endpoint string, flags timelineFlags) (tweets []Status) { } }() requestCount := 0 - maxID := "" + maxID := flags.maxID for len(tweets) < flags.count && requestCount < flags.maxRequests { tmp := timeline(endpoint, maxID) if len(tmp) == 0 { @@ -328,11 +328,13 @@ func timelineLoop(endpoint string, flags timelineFlags) (tweets []Status) { type timelineFlags struct { count int maxRequests int + maxID string } func timelineFlagsVars(s *flag.FlagSet, f *timelineFlags) { s.IntVar(&f.count, "count", DEFAULT_COUNT, "try to get up to N tweets") s.IntVar(&f.maxRequests, "max-requests", MAX_TIMELINE_REQUESTS, "try to achieve count with a maximum of N requests") + s.StringVar(&f.maxID, "max-id", "", "only get tweets with an ID lower or equal to max-id") } func mentions(flags timelineFlags, args []string) error {