mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-08 22:44:24 +08:00
Push Examples (#3735)
This commit is contained in:
20
extra/push-examples/go/index.go
Normal file
20
extra/push-examples/go/index.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
const PushURL = "https://example.com/api/push/key?status=up&msg=OK&ping="
|
||||
const Interval = 60
|
||||
|
||||
for {
|
||||
_, err := http.Get(PushURL)
|
||||
if err == nil {
|
||||
fmt.Println("Pushed!")
|
||||
}
|
||||
time.Sleep(Interval * time.Second)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user