chatterbot 2.0.5 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fd1f15ba5a3ff9b93011fd3da19223859262e10e
4
- data.tar.gz: a535d7da9c4107fb810d8e838e99f2d3feb5eeca
2
+ SHA256:
3
+ metadata.gz: 6b63ff09167dad5630abae41f3734aa861d4b4ad96c1cb643497bfc9ddc93483
4
+ data.tar.gz: bb89622d8d90d9e43ee7dddff4bedbb9854bb529bbe523a201a082b7a5a6383a
5
5
  SHA512:
6
- metadata.gz: 6f18198504ee50b9ba3015d7f45ea46061c14a55e4d02be568ef738d4e13567e9d7118473ff0c942a49a8fc0789cdda46f2d84acf69f35828f55da8283443774
7
- data.tar.gz: c57548daa22ef87724d6f101f2c3fee9922c7b7e953a62e395eb4b207ad3d86cf25602484dbf850a55de0b26a91c9e128dc2d3e797e390130b65c84a53d92297
6
+ metadata.gz: 1be88671b540eabdac657837ede78bc7ff376902fd3252fcde201bc5dac7d4e68153b875a611127eea83053c6d3e2434534c43b12ed265a578bd04cc8c09bc6c
7
+ data.tar.gz: fe5c7963868895b81ace0c6a9f66449442a8cc6d183b84107e7a6486ca674fb8433637cb3539b8ba694cd4caa46a48f90c247505fe6aea1e2b7b6592acc0a375
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Run tests
3
+ on: [push, pull_request]
4
+ jobs:
5
+ build:
6
+ strategy:
7
+ fail-fast: false
8
+ matrix:
9
+ os: [ubuntu-latest, macos-latest, windows-latest]
10
+ ruby: [2.5, 2.6, 2.7]
11
+ runs-on: ${{ matrix.os }}
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: ${{ matrix.ruby }}
17
+ bundler-cache: true
18
+ - name: rspec
19
+ run: bundle exec rake
data/Gemfile CHANGED
@@ -13,8 +13,8 @@ end
13
13
 
14
14
 
15
15
  group :test do
16
- gem 'rspec', '~> 3.5.0'
17
- gem 'rspec-mocks', '~> 3.5.0'
16
+ gem 'rspec', '~> 3.10.0'
17
+ gem 'rspec-mocks', '~> 3.10.0'
18
18
  gem 'simplecov', '>= 0'
19
19
  gem 'observr', '>= 0'
20
20
  end
data/README.markdown CHANGED
@@ -22,7 +22,6 @@ Features
22
22
  * Simple blocklist system to limit your annoyance of users
23
23
  * Avoid your bot making a fool of itself by ignoring tweets with
24
24
  certain bad words
25
- * Basic Streaming API support
26
25
 
27
26
 
28
27
  Using Chatterbot
@@ -102,25 +101,12 @@ that you should just be using the Twitter gem directly.
102
101
  Streaming
103
102
  ---------
104
103
 
105
- Chatterbot has some basic support for the Streaming API. If you want
106
- to do something complicated, you should probably consider using the
107
- [Twitter gem](https://github.com/sferik/twitter#streaming) directly.
108
-
109
- Basic usage is very straightforward:
110
-
111
- use_streaming true
112
- home_timeline do |tweet|
113
- puts "someone i follow tweeted! #{tweet.text}"
114
- end
115
-
116
-
117
- You can also run a search:
118
-
119
- use_streaming true
120
- search("pizza") do |tweet|
121
- puts "someone is talking about pizza! #{tweet.text}"
122
- end
123
-
104
+ Chatterbot used to have some basic support for the Streaming API, but
105
+ I've removed it because Twitter is removing and/or restricting access
106
+ to those APIs. If you need the Streaming API, I highly recommend using
107
+ the the [Twitter
108
+ gem](https://github.com/sferik/twitter#streaming). Chatterbot is built
109
+ on the Twitter gem, it works great, and has support for streaming.
124
110
 
125
111
 
126
112
  What Can I Do?
@@ -355,7 +341,7 @@ I can work with you on that.
355
341
  Copyright/License
356
342
  -----------------
357
343
 
358
- Copyright (c) 2016 Colin Mitchell. Chatterbot is distributed under the
344
+ Copyright (c) 2018 Colin Mitchell. Chatterbot is distributed under the
359
345
  MIT licence -- Please see LICENSE.txt for further details.
360
346
 
361
347
  http://muffinlabs.com
data/chatterbot.gemspec CHANGED
@@ -26,11 +26,11 @@ Gem::Specification.new do |s|
26
26
  # load activesupport but check ruby version along the way
27
27
  s.extensions << 'ext/mkrf_conf.rb'
28
28
 
29
- s.add_runtime_dependency(%q<oauth>, ["~> 0.4.7"])
30
- s.add_runtime_dependency(%q<twitter>, ["~> 6.2.0"])
29
+ s.add_runtime_dependency(%q<oauth>, ["~> 0.5.6"])
30
+ s.add_runtime_dependency(%q<twitter>, ["~> 7"])
31
31
  s.add_runtime_dependency(%q<launchy>, [">= 2.4.2"])
32
32
  s.add_runtime_dependency(%q<colorize>, [">= 0.7.3"])
33
33
 
34
- s.add_development_dependency 'bundler', '~> 1.0'
34
+ s.add_development_dependency 'bundler', '~> 2.0'
35
35
  end
36
36
 
@@ -9,15 +9,15 @@
9
9
  <meta name="description" content="twitter bots in ruby">
10
10
 
11
11
  <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
12
- <link rel="stylesheet" href="/css/syntax.css">
13
- <link rel="stylesheet" href="/css/main.css">
12
+ <link rel="stylesheet" href="/chatterbot/css/syntax.css">
13
+ <link rel="stylesheet" href="/chatterbot/css/main.css">
14
14
  </head>
15
15
  <body>
16
16
 
17
17
  <div class="container">
18
18
  <div class=row-fluid>
19
19
  <div id=header class=span12>
20
- <h4><a class=brand href="/">chatterbot</a>
20
+ <h4><a class=brand href="/chatterbot/">chatterbot</a>
21
21
  <small>twitter bots in ruby</small>
22
22
  </h4>
23
23
 
@@ -30,7 +30,7 @@
30
30
 
31
31
  <div id=navigation class=span2>
32
32
  <ul class="nav nav-list">
33
- <li><a href="/">Home</a></li>
33
+ <li><a href="/chatterbot/">Home</a></li>
34
34
 
35
35
 
36
36
 
@@ -56,7 +56,7 @@
56
56
 
57
57
  <li data-order="">
58
58
 
59
- <a href="/examples.html">Examples</a>
59
+ <a href="/chatterbot/examples.html">Examples</a>
60
60
 
61
61
  </li>
62
62
 
@@ -82,7 +82,7 @@
82
82
 
83
83
  <li data-order="">
84
84
 
85
- <a href="/setup.html">Authorizing Your Bot</a>
85
+ <a href="/chatterbot/setup.html">Authorizing Your Bot</a>
86
86
 
87
87
  </li>
88
88
 
@@ -97,14 +97,10 @@
97
97
 
98
98
 
99
99
 
100
-
101
-
102
-
103
-
104
100
 
105
101
  <li data-order="">
106
102
 
107
- <a href="/walkthrough.html">Walkthrough</a>
103
+ <a href="/chatterbot/walkthrough.html">Walkthrough</a>
108
104
 
109
105
  </li>
110
106
 
@@ -119,7 +115,7 @@
119
115
 
120
116
  <li data-order="">
121
117
 
122
- <a href="/advanced.html">Advanced Features</a>
118
+ <a href="/chatterbot/advanced.html">Advanced Features</a>
123
119
 
124
120
  </li>
125
121
 
@@ -129,7 +125,7 @@
129
125
 
130
126
  <li data-order="">
131
127
 
132
- <a href="/configuration.html">Configuration</a>
128
+ <a href="/chatterbot/configuration.html">Configuration</a>
133
129
 
134
130
  </li>
135
131
 
@@ -143,7 +139,7 @@
143
139
 
144
140
  <li data-order="">
145
141
 
146
- <a href="/deploying.html">Running your Bot</a>
142
+ <a href="/chatterbot/deploying.html">Running your Bot</a>
147
143
 
148
144
  </li>
149
145
 
@@ -157,7 +153,7 @@
157
153
 
158
154
  <li data-order="">
159
155
 
160
- <a href="/features.html">Basic Features</a>
156
+ <a href="/chatterbot/features.html">Basic Features</a>
161
157
 
162
158
  </li>
163
159
 
@@ -180,16 +176,6 @@
180
176
 
181
177
 
182
178
 
183
-
184
- <li data-order="">
185
-
186
- <a href="/streaming.html">Streaming API</a>
187
-
188
- </li>
189
-
190
-
191
-
192
-
193
179
 
194
180
 
195
181
 
@@ -218,7 +204,7 @@
218
204
 
219
205
  <li data-order="">
220
206
 
221
- <a href="/contributing.html">Contributing</a>
207
+ <a href="/chatterbot/contributing.html">Contributing</a>
222
208
 
223
209
  </li>
224
210
 
@@ -259,10 +245,6 @@
259
245
 
260
246
 
261
247
 
262
-
263
-
264
-
265
-
266
248
 
267
249
 
268
250
 
@@ -305,7 +287,7 @@
305
287
 
306
288
  <li data-order="">
307
289
 
308
- <a href="/other-tools.html">Other Tools</a>
290
+ <a href="/chatterbot/other-tools.html">Other Tools</a>
309
291
 
310
292
  </li>
311
293
 
@@ -330,10 +312,6 @@
330
312
 
331
313
 
332
314
 
333
-
334
-
335
-
336
-
337
315
 
338
316
  <li data-order="">
339
317
 
@@ -367,48 +345,57 @@
367
345
  have access to an instance of Twitter::Client provided by the
368
346
  <strong>client</strong> method. In theory, you can do something like this in your
369
347
  bot to unfollow users who DM you:</p>
370
- <div class="highlight"><pre><code class="language-text" data-lang="text">client.direct_messages_received(:since_id =&gt; since_id).each do |m|
348
+
349
+ <pre><code>client.direct_messages_received(:since_id =&gt; since_id).each do |m|
371
350
  client.unfollow(m.user.name)
372
351
  end
373
- </code></pre></div>
374
- <h2 id="storing-config-in-the-database">Storing Config in the Database</h2>
352
+ </code></pre>
375
353
 
354
+ <h2 id="storing-config-in-the-database">Storing Config in the Database</h2>
376
355
  <p>Sometimes it is preferable to store the authorization credentials for
377
- your bot in a database. </p>
356
+ your bot in a database.</p>
378
357
 
379
358
  <p>Chatterbot can manage configurations that are stored in the database,
380
359
  but to do this you will need to specify how to connect to the
381
360
  database. You can do this by specifying the connection string
382
- either in one of the global config files by setting </p>
383
- <div class="highlight"><pre><code class="language-text" data-lang="text">:db_uri:mysql://username:password@host/database
384
- </code></pre></div>
361
+ either in one of the global config files by setting</p>
362
+
363
+ <p><code>
364
+ :db_uri:mysql://username:password@host/database
365
+ </code></p>
366
+
385
367
  <p>Or you can specify the connection on the command-line by using the
386
- --db=&quot;db_uri&quot; configuration option. Any calls to the database are
368
+ db=”db_uri configuration option. Any calls to the database are
387
369
  handled by the Sequel gem, and MySQL and Sqlite should work. The DB
388
370
  URI should be in the form of</p>
389
- <div class="highlight"><pre><code class="language-text" data-lang="text">mysql://username:password@host/database
390
- </code></pre></div>
391
- <p>see <a href="http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html">http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html</a>
371
+
372
+ <pre><code>mysql://username:password@host/database
373
+ </code></pre>
374
+
375
+ <p>see http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html
392
376
  for details.</p>
393
377
 
394
378
  <h2 id="logging-tweets-to-the-database">Logging Tweets to the Database</h2>
395
379
 
396
380
  <p>Chatterbot can log tweet activity to a database if desired. This can
397
- be handy for archival purposes, or for tracking what&#39;s going on with
398
- your bot. </p>
381
+ be handy for archival purposes, or for tracking whats going on with
382
+ your bot.</p>
399
383
 
400
- <p>If you&#39;ve configured your bot for database access, you can store a
384
+ <p>If youve configured your bot for database access, you can store a
401
385
  tweet to the database by calling the <code>log</code> method like this:</p>
402
- <div class="highlight"><pre><code class="language-text" data-lang="text">search &quot;chatterbot&quot; do |tweet|
386
+
387
+ <p><code>
388
+ search "chatterbot" do |tweet|
403
389
  log tweet
404
390
  end
405
- </code></pre></div>
391
+ </code></p>
392
+
406
393
  <p>See <code>Chatterbot::Logging</code> for details on this.</p>
407
394
 
408
395
  <h2 id="streaming">Streaming</h2>
409
396
 
410
- <p>Chatterbot has basic support for Twitter&#39;s Streaming API. You can read
411
- more about it <a href="/streaming.html">here</a></p>
397
+ <p>Chatterbot has basic support for Twitters Streaming API. You can read
398
+ more about it <a href="streaming.html">here</a></p>
412
399
 
413
400
 
414
401
  </div>
@@ -417,7 +404,9 @@ more about it <a href="/streaming.html">here</a></p>
417
404
 
418
405
  <div class=row-fluid>
419
406
  <div id=footer class=span12>
420
- Documentation for <a href="https://github.com/muffinista/chatterbot">chatterbot</a>
407
+ <!--
408
+ Documentation for <a href="https://github.com/muffinista/chatterbot">chatterbot</a>
409
+ -->
421
410
 
422
411
  </div>
423
412
  </div>
@@ -9,15 +9,15 @@
9
9
  <meta name="description" content="twitter bots in ruby">
10
10
 
11
11
  <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
12
- <link rel="stylesheet" href="/css/syntax.css">
13
- <link rel="stylesheet" href="/css/main.css">
12
+ <link rel="stylesheet" href="/chatterbot/css/syntax.css">
13
+ <link rel="stylesheet" href="/chatterbot/css/main.css">
14
14
  </head>
15
15
  <body>
16
16
 
17
17
  <div class="container">
18
18
  <div class=row-fluid>
19
19
  <div id=header class=span12>
20
- <h4><a class=brand href="/">chatterbot</a>
20
+ <h4><a class=brand href="/chatterbot/">chatterbot</a>
21
21
  <small>twitter bots in ruby</small>
22
22
  </h4>
23
23
 
@@ -30,7 +30,7 @@
30
30
 
31
31
  <div id=navigation class=span2>
32
32
  <ul class="nav nav-list">
33
- <li><a href="/">Home</a></li>
33
+ <li><a href="/chatterbot/">Home</a></li>
34
34
 
35
35
 
36
36
 
@@ -56,7 +56,7 @@
56
56
 
57
57
  <li data-order="">
58
58
 
59
- <a href="/examples.html">Examples</a>
59
+ <a href="/chatterbot/examples.html">Examples</a>
60
60
 
61
61
  </li>
62
62
 
@@ -82,7 +82,7 @@
82
82
 
83
83
  <li data-order="">
84
84
 
85
- <a href="/setup.html">Authorizing Your Bot</a>
85
+ <a href="/chatterbot/setup.html">Authorizing Your Bot</a>
86
86
 
87
87
  </li>
88
88
 
@@ -97,14 +97,10 @@
97
97
 
98
98
 
99
99
 
100
-
101
-
102
-
103
-
104
100
 
105
101
  <li data-order="">
106
102
 
107
- <a href="/walkthrough.html">Walkthrough</a>
103
+ <a href="/chatterbot/walkthrough.html">Walkthrough</a>
108
104
 
109
105
  </li>
110
106
 
@@ -119,7 +115,7 @@
119
115
 
120
116
  <li data-order="">
121
117
 
122
- <a href="/advanced.html">Advanced Features</a>
118
+ <a href="/chatterbot/advanced.html">Advanced Features</a>
123
119
 
124
120
  </li>
125
121
 
@@ -129,7 +125,7 @@
129
125
 
130
126
  <li data-order="">
131
127
 
132
- <a href="/configuration.html">Configuration</a>
128
+ <a href="/chatterbot/configuration.html">Configuration</a>
133
129
 
134
130
  </li>
135
131
 
@@ -143,7 +139,7 @@
143
139
 
144
140
  <li data-order="">
145
141
 
146
- <a href="/deploying.html">Running your Bot</a>
142
+ <a href="/chatterbot/deploying.html">Running your Bot</a>
147
143
 
148
144
  </li>
149
145
 
@@ -157,7 +153,7 @@
157
153
 
158
154
  <li data-order="">
159
155
 
160
- <a href="/features.html">Basic Features</a>
156
+ <a href="/chatterbot/features.html">Basic Features</a>
161
157
 
162
158
  </li>
163
159
 
@@ -180,16 +176,6 @@
180
176
 
181
177
 
182
178
 
183
-
184
- <li data-order="">
185
-
186
- <a href="/streaming.html">Streaming API</a>
187
-
188
- </li>
189
-
190
-
191
-
192
-
193
179
 
194
180
 
195
181
 
@@ -218,7 +204,7 @@
218
204
 
219
205
  <li data-order="">
220
206
 
221
- <a href="/contributing.html">Contributing</a>
207
+ <a href="/chatterbot/contributing.html">Contributing</a>
222
208
 
223
209
  </li>
224
210
 
@@ -259,10 +245,6 @@
259
245
 
260
246
 
261
247
 
262
-
263
-
264
-
265
-
266
248
 
267
249
 
268
250
 
@@ -305,7 +287,7 @@
305
287
 
306
288
  <li data-order="">
307
289
 
308
- <a href="/other-tools.html">Other Tools</a>
290
+ <a href="/chatterbot/other-tools.html">Other Tools</a>
309
291
 
310
292
  </li>
311
293
 
@@ -330,10 +312,6 @@
330
312
 
331
313
 
332
314
 
333
-
334
-
335
-
336
-
337
315
 
338
316
  <li data-order="">
339
317
 
@@ -366,7 +344,7 @@ the OAuth credentials, timestamps, etc. Chatterbot offers a whole
366
344
  bunch of different methods of storing the config for your bot:</p>
367
345
 
368
346
  <ol>
369
- <li>Your credentials can be stored as variables in the script itself.
347
+ <li>Your credentials can be stored as variables in the script itself.
370
348
  If you generate a bot via <code>chatterbot-register</code>, the file will have
371
349
  these variables specified. However, if your bot source code is
372
350
  going to be public, you should NOT do this. Anyone who has your
@@ -374,19 +352,19 @@ credentials can do nasty things with your Twitter account. Also, if
374
352
  your bot is using replies or searches, chatterbot will need to
375
353
  track some state information, and that data will be written to a
376
354
  YAML file.</li>
377
- <li>In a YAML file with the same name as the bot, so if you have
355
+ <li>In a YAML file with the same name as the bot, so if you have
378
356
  botname.rb or a Botname class, store your config in botname.yaml.
379
357
  <code>chatterbot-register</code> will also create this file. If you are using
380
358
  git or another source code control system, you should <strong>NOT</strong> store
381
359
  this file! It will be updated every time your bots run.</li>
382
- <li>In a global config file at <code>/etc/chatterbot.yml</code> -- values stored here
360
+ <li>In a global config file at <code>/etc/chatterbot.yml</code> values stored here
383
361
  will apply to any bots you run.</li>
384
- <li>In another global config file specified in the environment variable
385
- <code>&#39;chatterbot_config&#39;</code>.</li>
386
- <li>In a <code>global.yml</code> file in the same directory as your bot. This
362
+ <li>In another global config file specified in the environment variable
363
+ <code>'chatterbot_config'</code>.</li>
364
+ <li>In a <code>global.yml</code> file in the same directory as your bot. This
387
365
  gives you the ability to have a global configuration file, but keep
388
366
  it with your bots if desired.</li>
389
- <li>In a database. You can read more about this on the <a href="/advanced.html">Advanced
367
+ <li>In a database. You can read more about this on the <a href="advanced.html">Advanced
390
368
  Features</a> page</li>
391
369
  </ol>
392
370
 
@@ -397,7 +375,9 @@ Features</a> page</li>
397
375
 
398
376
  <div class=row-fluid>
399
377
  <div id=footer class=span12>
400
- Documentation for <a href="https://github.com/muffinista/chatterbot">chatterbot</a>
378
+ <!--
379
+ Documentation for <a href="https://github.com/muffinista/chatterbot">chatterbot</a>
380
+ -->
401
381
 
402
382
  </div>
403
383
  </div>