twittbot 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/twittbot/bot.rb +2 -0
- data/lib/twittbot/botpart.rb +3 -2
- data/lib/twittbot/defaults.rb +1 -1
- data/lib/twittbot/gem_ext/twitter/tweet.rb +7 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b29c8971b76f6db4f0a8e608691d47e48197be4e
|
4
|
+
data.tar.gz: 48b6811b0919d1cb825f98f1aa7455b6bc302b89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 551cbe999c1dae4fe347daa60c8f24309a94aab01f94bb42dc9c5936fa9e89f28b2a8970530a18036ddef6f6f801b9dfb3242de98154ff69e0adaddd35424051
|
7
|
+
data.tar.gz: f8a898e947011620bac124ef5a3cf7b645097a1d8e9a8e83db7750bfe22223b0442f0f04dabc6bb09097c1232950fc3e77820d7f5ae0738efa85974b8e39333b
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.0
|
4
|
+
|
5
|
+
* Add `expanded_text` method to Tweet objects which returns the full >140 character tweet text.
|
6
|
+
* Add `:deleted` to `on :tweet` options
|
7
|
+
|
3
8
|
## 0.4.0
|
4
9
|
|
10
|
+
* Add `tweet.favourite` method
|
11
|
+
* Add `:favorite` to `on :tweet` options
|
12
|
+
* Fix periodic blocks being called 1 minute later than expected
|
5
13
|
* Add `twittbot cron` for interacting with the bot outside from Twittbot processes, e.g. via cron
|
6
14
|
* Modify `retweet-bot` template to ignore retweets from ourselves
|
7
15
|
* Add new `big-ben-clock` template which demonstrates the usage of `twittbot cron`.
|
data/lib/twittbot/bot.rb
CHANGED
@@ -208,6 +208,8 @@ module Twittbot
|
|
208
208
|
end
|
209
209
|
when Twitter::DirectMessage
|
210
210
|
do_direct_message object, opts
|
211
|
+
when Twitter::Streaming::DeletedTweet
|
212
|
+
do_callbacks :deleted, object, opts
|
211
213
|
else
|
212
214
|
puts "no handler for #{object.class.to_s}\n -- object data:"
|
213
215
|
require 'pp'
|
data/lib/twittbot/botpart.rb
CHANGED
@@ -17,7 +17,7 @@ module Twittbot
|
|
17
17
|
|
18
18
|
# Adds a new callback to +name+.
|
19
19
|
# @param name [Symbol] The callback type.
|
20
|
-
# Can be
|
20
|
+
# Can be one of:
|
21
21
|
#
|
22
22
|
# * :tweet
|
23
23
|
# * :mention
|
@@ -26,6 +26,7 @@ module Twittbot
|
|
26
26
|
# * :friend_list
|
27
27
|
# * :direct_message (i.e. not command DMs, see {cmd} for that)
|
28
28
|
# * :load (when the bot finished initializing)
|
29
|
+
# * :deleted (when a tweet got deleted, only stores id in object)
|
29
30
|
def on(name, *args, &block)
|
30
31
|
$bot[:callbacks][name] ||= []
|
31
32
|
$bot[:callbacks][name] << {
|
@@ -44,7 +45,7 @@ module Twittbot
|
|
44
45
|
# @param options [Hash] A customizable set of options.
|
45
46
|
# @option options [Boolean] :run_at_start (true) Run the code in +block+ when the bot finished starting.
|
46
47
|
def every(interval, unit = :minutes, options = {}, &block)
|
47
|
-
raise "Not a
|
48
|
+
raise "Not a Integer: #{interval}" unless interval.is_a? Integer
|
48
49
|
raise "Interval less than 1" if interval < 1
|
49
50
|
|
50
51
|
opts = {
|
data/lib/twittbot/defaults.rb
CHANGED
@@ -54,5 +54,11 @@ module Twitter
|
|
54
54
|
end
|
55
55
|
userlist
|
56
56
|
end
|
57
|
+
|
58
|
+
# Returns the full expanded tweet (over 140 characters)
|
59
|
+
# @return [String] The expanded tweet
|
60
|
+
def expanded_text
|
61
|
+
self.attrs.dig(:extended_tweet, :full_text) || full_text || text
|
62
|
+
end
|
57
63
|
end
|
58
|
-
end
|
64
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twittbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nilsding
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.
|
178
|
+
rubygems_version: 2.6.13
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: An advanced Twitter bot.
|