-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbot_tutorial.html
More file actions
70 lines (68 loc) · 2.55 KB
/
bot_tutorial.html
File metadata and controls
70 lines (68 loc) · 2.55 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<html>
<head><title>NECOMAtter BOT create tutorial</title>
<link href="/static/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/static/NECOMAtter.css">
</head>
<body>
<h2>How to create NECOMAtter BOT</h2>
<div class="memo">
When you make BOT in NECOMAtter, it is necessary to perform two of the making of the BOT-user and the generation of API-KEY.
I perform the making of the BOT-user from the <a href="/signup">sign up page</a>.
When you make a user and enter the signature in NECOMAtter, a page of the <a href="/user_setting/">API-KEY setting page</a> is available. Please make API-KEY in this page.
</div>
<div class="memo">
There is two kinds of BOT of NECOMAtter.
<ul>
<li><a href="#POST_BOT">POST BOT</a></li>
<li><a href="#STREAM_BOT">STREAM BOT</a></li>
</ul>
POST BOT is BOT to perform tweet.
STREAM BOT is BOT to watch tweet.
In many cases, STREAM BOT will have the function of the POST.
</div>
<h3 id="POST_BOT">POST BOT</h3>
<div class="memo">
POST_BOT performs tweet by performing a POST of the data of the JSON form for the following URLs.
<ul>
<li>REST URL: <a href="/post.json">/post.json</a></li>
<li>HTTP METHOD: POST</li>
<li>required header: <code>Content-Type: application/json; charset=utf-8</code></li>
<li>POST data: JSON
<code>
{
"user_name": "user name string",
"api_key": "API-KEY string",
"text": "mew text"
"reply_to": number of mew_id // can be omitted
}
</code>
</ul>
</div>
<h4>example:</h4>
<div class="memo">
<code>curl -H "content-type: application/json" -d '{"user_name": "YOUR ACCOUNT NAME", "api_key": “YOUR APKEY", "text": "MEW TEXT"}' https://necomatter.necoma-project.jp/post.json</code>
</div>
<h3 id="STREAM_BOT">STREAM BOT</h3>
<div class="memo">
STREAM_BOT is to perform a POST of the data of the JSON form for the following URLs and can watch tweet stream.
<ul>
<li>REST URL: <a href="/stream/regexp.json">/stream/regexp.json</a></li>
<li>HTTP METHOD: POST</li>
<li>required header: <code>Content-Type: application/json; charset=utf-8</code></li>
<li>POST data: JSON
<code>
{
"user_name": "user name string",
"api_key": "API-KEY string",
"regexp": "regular expression",
"description": "BOT description text"
}
</code>
</ul>
</div>
<h4>example:</h4>
<div class="memo">
<code>curl -H "content-type: application/json" -d '{"user_name": "YOUR ACCOUNT NAME", "api_key": "YOUR APKEY", "regexp": "reguler expression string", "description": "BOT description"}' https://necomatter.necoma-project.jp/stream/regexp.json</code>
</div>
</body>
</html>