main.go 282 B

12345678910111213141516171819
  1. package main
  2. import (
  3. "bufio"
  4. "log"
  5. "net/http"
  6. )
  7. func main() {
  8. resp, err := http.Get("https://ntfy.sh/phil_alerts/json")
  9. if err != nil {
  10. log.Fatal(err)
  11. }
  12. defer resp.Body.Close()
  13. scanner := bufio.NewScanner(resp.Body)
  14. for scanner.Scan() {
  15. println(scanner.Text())
  16. }
  17. }