telegram-pusher/index.php

32 lines
914 B
PHP
Raw Permalink Normal View History

2018-03-11 03:54:38 +00:00
<!DOCTYPE html>
<head>
<title>Pusher Test</title>
<script src="https://js.pusher.com/4.1/pusher.min.js"></script>
2018-12-19 07:35:11 +00:00
<script src="https://raw.githubusercontent.com/Nickersoft/push.js/master/bin/push.min.js" type="text/javascript"></script>
2018-03-11 03:54:38 +00:00
<script>
// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;
var pusher = new Pusher('your-appid', {
cluster: 'us2',
encrypted: true
});
var channel = pusher.subscribe('<?php echo $_GET['channel']; ?>');
channel.bind('my-event', function(data) {
2018-12-19 07:35:11 +00:00
Push.create(data.message);
2018-03-11 03:54:38 +00:00
});
</script>
2018-12-19 07:35:11 +00:00
</head>
2018-03-11 03:54:38 +00:00
Your notify link: <a href="https://dev.c0defox.es/push/?channel=<?php echo $_GET['channel']; ?>">Get Notified</a>
<br />
Leave this page open on your phone and go about your day.<br />
2018-12-19 07:35:11 +00:00
When the person who created this push channel writes a message, you will get a notification