mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-01 02:59:24 +02:00
Continued docs
This commit is contained in:
parent
7ba268887b
commit
246061829b
17 changed files with 421 additions and 54 deletions
examples/subscribe-go
19
examples/subscribe-go/main.go
Normal file
19
examples/subscribe-go/main.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
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())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue