ntfy-playground/sub.go
Vincent Batts b68358a57a
initial commit: silly simple notifications pub/sub with ntfy.sh
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2023-06-03 09:11:59 -04:00

23 lines
312 B
Go

//go:build ignore
// +build ignore
package main
import (
"bufio"
"log"
"net/http"
)
func main() {
resp, err := http.Get("https://ntfy.sh/farts/raw")
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
scanner := bufio.NewScanner(resp.Body)
for scanner.Scan() {
println(scanner.Text())
}
}