1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-11-23 11:49:19 +01:00
ntfy/examples/subscribe-go/main.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
282 B
Go
Raw Normal View History

2021-12-04 02:38:21 +01:00
package main
import (
"bufio"
"log"
"net/http"
)
func main() {
resp, err := http.Get("https://ntfy.sh/phil_alerts/json")
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
scanner := bufio.NewScanner(resp.Body)
for scanner.Scan() {
println(scanner.Text())
}
}