-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
58 lines (55 loc) · 3.29 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cleverbot.io CDN | Powered By Fastly</title>
<link href="//cdn.cleverbot.io/web/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="//cdn.cleverbot.io/web/github.min.css">
<link href="//cdn.cleverbot.io/web/styles.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-8 col-md-offset-2" style="text-align:center;">
<a href="https://cleverbot.io" style="text-align:left;"><h4>Back to main site</h4></a>
<h1 style="opacity:0.5"><i class="fa fa-code" style="opacity:0.5;"></i><br> Quick Start</h1><hr>
<div role="tabpanel">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#js" aria-controls="profile" role="tab" data-toggle="tab">Browser JavaScript</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active mdd" id="js"><br>
<p>To use this package, simply <a class="btn-link" href="https://github.com/CleverbotIO/cleverbot.io.js/archive/master.zip">download</a> it, place <em>cleverbot.io.min.js</em> in the web directory add the following to your page</p>
<pre><code class="html"><script src="cleverbot.io.min.js"></script>
</code></pre><p>or you can use the Cleverbot.io CDN</p>
<pre><code class="html"><script src="//cdn.cleverbot.io/build/1.0/cleverbot.io.min.js"></script>
</code></pre>
<p>Before using this module, please get your API keys at <a href="https://cleverbot.io/keys">https://cleverbot.io/keys</a></p>
<p>To initialize cleverbot, create a new instance of cleverbot</p>
<pre><code class="javascript">var bot = new cleverbot("YOUR_API_USER", "YOUR_API_KEY");
</code></pre><p><em>cleverbot.io</em> allows you to save cleverbot sessions to access later<br>If you've already created a session previously, simply add the following code to reference it</p>
<pre><code class="javascript">bot.setNick("sessionname")
</code></pre><p>To create or access a cleverbot session, start with the following</p>
<pre><code class="javascript">bot.create(function (err, session) {
// session is your session name, it will either be as you set it previously, or cleverbot.io will generate one for you
// Woo, you initialized cleverbot.io. Insert further code here
});
</code></pre><p>Now querying cleverbot is simple, you pass the text to the <em>.ask()</em> method</p>
<pre><code class="javascript">bot.ask("Just a small town girl", function (err, response) {
console.log(response); // Will likely be: "Living in a lonely world"
});
</code></pre><p>Well, that's it for now! Happy hacking!</p>
<p><strong>Cleverbot.io is free and open source, and will remain so.</strong></p>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="//cdn.cleverbot.io/web/jquery.min.js"></script>
<script src="//cdn.cleverbot.io/web/bootstrap.min.js"></script>
<script src="//cdn.cleverbot.io/web/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>