Skip to content

Instantly share code, notes, and snippets.

@tvldz
Last active November 9, 2019 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvldz/39291c00b5a1bad767e8ae8239b85e44 to your computer and use it in GitHub Desktop.
Save tvldz/39291c00b5a1bad767e8ae8239b85e44 to your computer and use it in GitHub Desktop.
shmooping: Rapidly observes for changes in the HTTP response body of landing.shmoocon.org
package main
import (
"fmt"
"net/http"
"time"
"bytes")
const URL = "http://landing.shmoocon.org/"
const msDelay = 200
func main() {
buf := make([]byte, 4092)
comparison := make([]byte, 4092)
temp := make([]byte, 4092)
for {
resp, _ := http.Get(URL)
resp.Body.Read(comparison)
if ! (bytes.Equal(buf, comparison)) {
fmt.Printf("%s\a\n", time.Now())
temp = buf
buf = comparison
comparison = temp
}
time.Sleep(msDelay * time.Millisecond)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment