tweetlr 0.1.33 → 0.1.34
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/lib/tweetlr/processors/twitter.rb +9 -4
- data/lib/tweetlr.rb +1 -1
- data/spec/processors/twitter_processor_spec.rb +8 -5
- data/tweetlr.gemspec +1 -1
- 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: 0c9dad0a0520b23a7bad8320b9201b8532565840
|
4
|
+
data.tar.gz: c978579a001652cc5f2c6b7647936341c908326d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ea2c9e42f4902069eefed131f2a358912b8594588d532e01cd9d387ed1fedf8502fd579a8af43edfabf9ac4e045b2db6e5c0a594c9bcc01ed15393bc5d4b2b5
|
7
|
+
data.tar.gz: ec2d6c170670baf3439de8c87ddea5d6553dfd7be8fa1cbcfdd9c9fd4bb70ec0a0b0eab3eaf67f046103f0f72ff7f184a9189df64376cf1e702af6feaf297340
|
@@ -73,10 +73,15 @@ private
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
def self.call_twitter_with(search_call, config, lazy)
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
begin
|
77
|
+
if lazy
|
78
|
+
response = ::Twitter.search(search_call, :since_id => config['since_id'] || config[:since_id], :count => config[:results_per_page], :result_type => config[:result_type])
|
79
|
+
else
|
80
|
+
response = ::Twitter.search(search_call, :count => config[:results_per_page], :result_type => config[:result_type])
|
81
|
+
end
|
82
|
+
rescue ::Twitter::Error::Client => error
|
83
|
+
log.error "Twitter client error: (#{error})"
|
84
|
+
response
|
80
85
|
end
|
81
86
|
response
|
82
87
|
end
|
data/lib/tweetlr.rb
CHANGED
@@ -19,11 +19,14 @@ describe Tweetlr::Processors::Twitter do
|
|
19
19
|
tweets.should_not be_empty
|
20
20
|
end
|
21
21
|
it "copes with errors by retrying, not raising" do
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
::Twitter.stub(:search).and_raise(::Twitter::Error::TooManyRequests)
|
23
|
+
Tweetlr::Processors::Twitter.stub!(:sleep) #releasing the sleep handbrake...
|
24
|
+
expect { Tweetlr::Processors::Twitter.call_twitter_api('mocky wocky',{})}.to_not raise_error(::Twitter::Error::TooManyRequests)
|
25
|
+
end
|
26
|
+
it "copes with client errors" do
|
27
|
+
::Twitter.stub(:search).and_raise(::Twitter::Error::ClientError)
|
28
|
+
expect { Tweetlr::Processors::Twitter.call_twitter_api('mocky wocky',{})}.to_not raise_error(::Twitter::Error::TooManyRequests)
|
29
|
+
end
|
27
30
|
end
|
28
31
|
describe "#lazy_search(config)" do
|
29
32
|
it "searches twitter for a given term" do
|
data/tweetlr.gemspec
CHANGED