Created
July 15, 2018 15:01
-
-
Save lefuturiste/d43e23b003f568f2c8565467ce83ca69 to your computer and use it in GitHub Desktop.
Useful code
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"log" | |
) | |
func main() { | |
//change me: | |
var url = "http://stantabcorp.com" | |
var user_agent = "LEL" | |
// do not change bellow this line | |
var count = 0 | |
fmt.Println("start... \n") | |
for { | |
client := &http.Client{} | |
req, err := http.NewRequest("GET", url, nil) | |
if err != nil { | |
log.Fatalln(err) | |
} | |
req.Header.Set("User-Agent", user_agent) | |
resp, err := client.Do(req) | |
if err != nil { | |
log.Fatalln(err) | |
} | |
defer resp.Body.Close() | |
count++ | |
fmt.Println(count) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment