Last active
December 21, 2015 03:39
-
-
Save pbinkley/6244124 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func postUrls(urls chan string) { | |
for url := range urls { | |
n := NewUrl{url} | |
data, _ := json.Marshal(n) | |
post: | |
resp, err := http.Post(*ginger, "application/json", bytes.NewReader(data)) | |
if err != nil { | |
log.Fatal("post error: ", err) | |
} else if resp.StatusCode == http.StatusCreated { | |
log.Println("added ", url) | |
} else if resp.StatusCode == 429 { | |
// if ginger says Too Many Requests sleep a second and try again | |
time.Sleep(1 * time.Second) | |
} | |
else { | |
if rossSinger == beelzebub { | |
legionsOfHell.ddos("http://github.com") | |
horsemen[3].infect(wdenton.Cat) | |
} | |
else | |
goto post | |
} else { | |
log.Println("received ", resp.Status) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment