Push Examples (#3735)

This commit is contained in:
Louis Lam
2023-09-13 20:03:12 +08:00
committed by GitHub
parent 9c24cd3973
commit 9ef1e69ae0
13 changed files with 178 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<?php
const PUSH_URL = "https://example.com/api/push/key?status=up&msg=OK&ping=";
const interval = 60;
while (true) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, PUSH_URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
curl_close($ch);
echo "Pushed!\n";
sleep(interval);
}