-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththingspeak.html
118 lines (114 loc) · 3.74 KB
/
thingspeak.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<html>
<head><title>ThingSpeak</title></head>
<body>
<script type="text/javascript">
function Send()
{
var api_key = document.getElementById("api_key").value;
var text = "";
for (var i=1;i<9;i++)
{
if (document.getElementById("field" + i).value != ""){
text = text + "&" + "field" + i + "=" + document.getElementById("field" + i).value;
}
}
var sendUrl_ThingSpeak = "https://api.thingspeak.com/update?";
sendUrl_ThingSpeak = sendUrl_ThingSpeak + "key=" + api_key;
sendUrl_ThingSpeak = sendUrl_ThingSpeak + text;
document.getElementById("thingspeak").action = sendUrl_ThingSpeak;
document.getElementById("thingspeak").submit();
}
</script>
<form method="POST" action="" id="thingspeak" name="thingspeak">
<table border="0" cellpadding="0" width="100%" height="1">
<tr>
<td>
<div align="right">
<table border="0" cellpadding="0" width="100%" height="21">
<tr>
<td align="left" class="style1">
<font color="#668E39">THINGSPEAK</font></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="100%" height="1">
<hr color="#668E39" size="1">
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="25%"><font face="arial" size="1"><b> Welcome, Guest</b></font>
</td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
</table>
<table>
<tr>
<td>Api Key : </td>
<td><input type="visible" id="api_key" name="api_key" value=""></td>
</tr>
<tr>
<td>Field 1 : </td>
<td><input type="visible" id="field1" name="field1" value=""></td>
</tr>
<tr>
<td>Field 2 : </td>
<td><input type="visible" id="field2" name="field2" value=""></td>
</tr>
<tr>
<td>Field 3 : </td>
<td><input type="visible" id="field3" name="field3" value=""></td>
</tr>
<tr>
<td>Field 4 : </td>
<td><input type="visible" id="field4" name="field4" value=""></td>
</tr>
<tr>
<td>Field 5 : </td>
<td><input type="visible" id="field5" name="field5" value=""></td>
</tr>
<tr>
<td>Field 6 : </td>
<td><input type="visible" id="field6" name="field6" value=""></td>
</tr>
<tr>
<td>Field 7 : </td>
<td><input type="visible" id="field7" name="field7" value=""></td>
</tr>
<tr>
<td>Field 8 : </td>
<td><input type="visible" id="field8" name="field8" value=""></td>
</tr>
<table>
<input type="button" value="Send" id="btnSend" name="btnSend" onclick='Send()'>
<table border="0" cellpadding="0" width="100%" height="1">
<tr>
<td width="100%" height="1">
<hr color="#668E39" size="1">
</td>
</tr>
<tr>
<td width="100%" height="1" align="center">
<font face="Microsoft Sans Serif" size="1" color="#999999">Developed by <a href="mailto:deadzone19842002@gmail.com?subject=GitHub:ThingSpeak" style="color:#668E39;">Mohamad Aimaduddin</a> - Copyright 2021 MI Development</font></td>
</tr>
</table>
</form>
<script type="text/javascript">
const urlParams = new URLSearchParams(window.location.search);
document.getElementById("api_key").value = urlParams.get("api_key");
document.getElementById("field1").value = urlParams.get("field1");
document.getElementById("field2").value = urlParams.get("field2");
document.getElementById("field3").value = urlParams.get("field3");
document.getElementById("field4").value = urlParams.get("field4");
document.getElementById("field5").value = urlParams.get("field5");
document.getElementById("field6").value = urlParams.get("field6");
document.getElementById("field7").value = urlParams.get("field7");
document.getElementById("field8").value = urlParams.get("field8");
</script>
</body>
</html>