From bc121ce87b79f0e8b9f952926076c800aa560129 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Thu, 20 Apr 2023 00:20:46 +0200 Subject: [PATCH] Use infinite loop --- main.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 27fa5c6..4fa8ef7 100644 --- a/main.go +++ b/main.go @@ -1,9 +1,14 @@ package main +import "time" + func main() { - stories := FetchHackerNewsTopStories() - filtered := CurateContentForStackerNews(&stories) - for _, story := range *filtered { - PostStoryToStackerNews(&story) + for { + stories := FetchHackerNewsTopStories() + filtered := CurateContentForStackerNews(&stories) + for _, story := range *filtered { + PostStoryToStackerNews(&story) + } + time.Sleep(time.Hour) } }