twitter_ebooks 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/twitter_ebooks/model.rb +17 -8
- data/lib/twitter_ebooks/version.rb +1 -1
- data/spec/data/0xabad1dea.model +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88ce1252a7ecb18f0d8670a180528c65083e22cd
|
4
|
+
data.tar.gz: 7af9ad8f5464571d0e3f9d394805fd4244910807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef1e74a136e604aa89bb0a792303b24c8b24b22bf74a9ad3a9971d7341f6f6df7c4db2961b394601f24ceb38e44452284d942915e94894f872b1f9ed9c6f852c
|
7
|
+
data.tar.gz: 6d8dc5f5c3c98a5459424c4eb5c1eb6f60c161989d58b13e2e5702a0b3eb72d9dc9cfa5adf8117fb6cfab5040d67c5ad3f458cde614622f1fdb0300cc0d99964
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# twitter\_ebooks 2.3.
|
1
|
+
# twitter\_ebooks 2.3.1
|
2
2
|
|
3
3
|
Rewrite of my twitter\_ebooks code. While the original was solely a tweeting Markov generator, this framework helps you build any kind of interactive twitterbot which responds to mentions/DMs. See [ebooks\_example](https://github.com/mispy/ebooks_example) for an example of a full bot.
|
4
4
|
|
data/lib/twitter_ebooks/model.rb
CHANGED
@@ -15,7 +15,23 @@ module Ebooks
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.load(path)
|
18
|
-
Marshal.load(File.open(path, 'rb') { |f| f.read })
|
18
|
+
props = Marshal.load(File.open(path, 'rb') { |f| f.read })
|
19
|
+
@tokens = props[:tokens]
|
20
|
+
@sentences = props[:sentences]
|
21
|
+
@mentions = props[:mentions]
|
22
|
+
@keywords = props[:keywords]
|
23
|
+
end
|
24
|
+
|
25
|
+
def save(path)
|
26
|
+
File.open(path, 'wb') do |f|
|
27
|
+
f.write(Marshal.dump({
|
28
|
+
tokens: @tokens,
|
29
|
+
sentences: @sentences,
|
30
|
+
mentions: @mentions,
|
31
|
+
keywords: @keywords
|
32
|
+
}))
|
33
|
+
end
|
34
|
+
self
|
19
35
|
end
|
20
36
|
|
21
37
|
def initialize
|
@@ -98,13 +114,6 @@ module Ebooks
|
|
98
114
|
self
|
99
115
|
end
|
100
116
|
|
101
|
-
def save(path)
|
102
|
-
File.open(path, 'wb') do |f|
|
103
|
-
f.write(Marshal.dump(self))
|
104
|
-
end
|
105
|
-
self
|
106
|
-
end
|
107
|
-
|
108
117
|
def fix(tweet)
|
109
118
|
# This seems to require an external api call
|
110
119
|
#begin
|
data/spec/data/0xabad1dea.model
CHANGED
Binary file
|