-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
36 lines (32 loc) · 872 Bytes
/
Copy pathindex.php
File metadata and controls
36 lines (32 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/*
WeMo Web Controller
by Paul Loeb
@loebpaul
https://github.com/loebpaul/wemo-web-controller
I am not affiliated with WeMo or Belkin, Inc. in any way.
*/
require_once('config.php');
$devices = "";
foreach ($IFTTT_RECIPES as $name=>$recipe){
$devices.="<button id=\"".$name."\">".$name."</button>";
}
?>
<html>
<head><title>WeMo Web Controller</title></head>
<style type="text/css">
button {font:14px arial;border:solid 1px #000;background:#fff;padding:1em 2em;cursor:pointer;margin:1em;}
</style>
<body>
<h1>WeMo Web Controller</h1>
<?php echo $devices; ?>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
$(function(){
$("button").click(function(){
$.post("post.php",{"name":this.id});
});
});
</script>
</body>
</html>