Initial commit

This commit is contained in:
2024-12-30 05:36:42 -07:00
commit 39cea7b77c
7 changed files with 480 additions and 0 deletions

34
main.go Normal file
View File

@@ -0,0 +1,34 @@
package main
import (
"log"
"time"
"github.com/cwpearson/reddit-images/rate_limit"
"github.com/cwpearson/reddit-images/reddit"
)
func main() {
subreddits := []string{
"pics",
"oldschoolcool",
"thewaywewere",
"MilitaryPorn",
"EarthPorn",
}
rl := rate_limit.NewRateLimit()
for {
for _, subreddit := range subreddits {
r := reddit.NewReddit(rl, subreddit)
r.Get()
}
when := time.Now().Add(time.Minute * time.Duration(30))
log.Println("sleep until", when)
time.Sleep(time.Until(when))
}
}