-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (49 loc) ยท 2.58 KB
/
index.html
File metadata and controls
54 lines (49 loc) ยท 2.58 KB
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
<!DOCTYPE html>
<html>
<style>
#result { float:left; border: 1px solid #666; background-color: #eee; padding: 10px; width:500px;height: 500px; overflow:scroll;}
#desc {float:left; width:500px; padding: 10px;}
</style>
<body>
<h2><img src="icon.jpg" width="32" align="absmiddle"> Mpbot Debugger 1.0</h2>
<div id="result"></div>
<div id="desc">
<b>๋ชฉ์ </b>
<p>๋ณธ ํ๋ก๊ทธ๋จ์ ์ธํธ๋ผ๋ท์ ๊ฐ๋ฐ ์๋ฒ์ <a href="http://dna.daum.net/apis/mypeople/ref" target="_blank">๋ง์ดํผํ ๋ด API</a> ์๋ฒ ๊ฐ์ ์ฐ๊ฒฐ ๋ฐ ์ค์๊ฐ HTTP ๋ก๊ทธ๋ฅผ ํตํ์ฌ ํจ์จ์ ์ธ ๋๋ฒ๊น
์ ์ํด ๋ง๋ค์ด์ก์ต๋๋ค.
๋ณธ ํ์ด์ง๋ HTML5 Server-sent event๋ก ๊ตฌํ๋์์ต๋๋ค. Firefox, Chrome, Safari๋ฅผ ์ฌ์ฉํ์๊ธฐ ๋ฐ๋๋๋ค.</p>
<b>์ค์น ๋ฐฉ๋ฒ</b>
<ol>
<li>์๋ฒ์ชฝ ์ฝ๋๋ <a href="https://github.com/channy/mpbot-debugger/blob/master/callback.php" target="_blank">callback.php</a>์ ์์ต๋๋ค. ๋ง์ดํผํ ๋ด ์ค์ ์ ์ฝ๋ฐฑ URL์ ๋ฃ์ผ์๋ฉด ๋ฉ๋๋ค.
<li>ํด๋ผ์ด์ธํธ ์ฝ๋๋ ๋ณธ HTML ํ์ด์ง์์ ์๋ ์๋ฒ ์คํฌ๋ฆฝํธ๋ง ์์ ํ๋ฉด ๋ฉ๋๋ค.<br>
<small>var source=new EventSource("callback.php");</small>
<li>๋ก๊ทธ ํ์ผ์ 4k์ด์ ์ปค์ง๋ฉด ์๋์ผ๋ก ์ง์์ง๋๋ค.
</ol>
<b>ํ
์คํธ ๋ฐฉ๋ฒ</b><br>
<ol>
<li>๋ง์ดํผํ PC ๋ฒ์ ์ ๋ก๊ทธ์ธ ํฉ๋๋ค.
<li>'์น๊ตฌ์ถ๊ฐ' ํญ์์ 'ID ์น๊ตฌ์ฐพ๊ธฐ'๋ฅผ ๋๋ฌ 'channy.bot'์ ์
๋ ฅํฉ๋๋ค.
<li>์น๊ตฌ ์ถ๊ฐ์ ๋ํ addBuddy ์ฝ๋ฐฑ ๋ก๊ทธ๊ฐ ๋ณด์
๋๋ค.
<li>๋ฉ์์ง๋ฅผ ์
๋ ฅ ํ์๋ฉด sendFromMessage ์ฝ๋ฐฑ ๋ก๊ทธ๊ฐ ๋ณด์
๋๋ค.
<li>๋ด ์๋ต ๊ธฐ๋ฅ์ ๊ฐ์ ๊ฐ๋ฐ ์๋ฒ์ <a href="https://github.com/channy/mpbot-debugger/blob/master/action.php" target="_blank">action.php</a>์ด๋ฉฐ, <a href="https://github.com/daumdna/apis/blob/master/Samples/8.Mypeople/BotAPI/PHP/callback.php" target="_blank">๋ด API ์ํ ์ฝ๋</a>๋ฅผ ๊ธฐ๋ฐํ์์ต๋๋ค.
<li>๋ ์์ธํ ์ฌํญ์ <a href="http://github.com/channy/mpbot-debugger">github ์ฝ๋</a>๋ฅผ ์ฐธ๊ณ ํ์ธ์.
</ol>
</div>
<footer>
<small>Except where otherwise noted, content on this site is licensed under the Creative Commons Attribution Share-Alike License v3.0 or any later version.</small>
</footer>
<script>
if(typeof(EventSource)!=="undefined")
{
var source=new EventSource("callback.php");
source.onmessage=function(event)
{
document.getElementById("result").innerHTML="<pre>" + event.data + "<pre>";
};
}
else
{
document.getElementById("result").innerHTML="ํ์ฌ ๋ธ๋ผ์ฐ์ ๋ Server-sent Event๋ฅผ ์ง์ํ์ง ์์ต๋๋ค. Firefox, Chrome, Safari ๋ฑ์ ์ฌ์ฉํด ๋ณด์ธ์! ";
}
</script>
</body>
</html>