summaryrefslogtreecommitdiffstats
path: root/extra/push-examples/php/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'extra/push-examples/php/index.php')
-rw-r--r--extra/push-examples/php/index.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/extra/push-examples/php/index.php b/extra/push-examples/php/index.php
new file mode 100644
index 0000000..d08b451
--- /dev/null
+++ b/extra/push-examples/php/index.php
@@ -0,0 +1,13 @@
+<?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);
+}