statement 1.5 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/statement/tweets.rb +8 -2
- data/lib/statement/version.rb +1 -1
- data/statement.gemspec +1 -1
- metadata +8 -8
data/lib/statement/tweets.rb
CHANGED
@@ -3,7 +3,7 @@ require 'twitter'
|
|
3
3
|
module Statement
|
4
4
|
class Tweets
|
5
5
|
|
6
|
-
attr_accessor :client, :timeline, :bulk_timeline
|
6
|
+
attr_accessor :client, :rest_client, :timeline, :bulk_timeline
|
7
7
|
|
8
8
|
def initialize
|
9
9
|
@@config = Statement.config rescue nil || {}
|
@@ -13,6 +13,12 @@ module Statement
|
|
13
13
|
:oauth_token => @@config[:oauth_token] || ENV['OAUTH_TOKEN'],
|
14
14
|
:oauth_token_secret => @@config[:oauth_token_secret] || ENV['OAUTH_TOKEN_SECRET']
|
15
15
|
)
|
16
|
+
@rest_client = Twitter::REST::Client.new(
|
17
|
+
:consumer_key => @@config[:consumer_key] || ENV['CONSUMER_KEY'],
|
18
|
+
:consumer_secret => @@config[:consumer_secret] || ENV['CONSUMER_SECRET'],
|
19
|
+
:oauth_token => @@config[:oauth_token] || ENV['OAUTH_TOKEN'],
|
20
|
+
:oauth_token_secret => @@config[:oauth_token_secret] || ENV['OAUTH_TOKEN_SECRET']
|
21
|
+
)
|
16
22
|
end
|
17
23
|
|
18
24
|
# fetches single twitter user's timeline
|
@@ -24,7 +30,7 @@ module Statement
|
|
24
30
|
def users(member_ids)
|
25
31
|
results = []
|
26
32
|
member_ids.each_slice(100) do |batch|
|
27
|
-
results <<
|
33
|
+
results << rest_client.users(batch)
|
28
34
|
end
|
29
35
|
results.flatten
|
30
36
|
end
|
data/lib/statement/version.rb
CHANGED
data/statement.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler"
|
21
|
+
spec.add_development_dependency "bundler"
|
22
22
|
spec.add_dependency "rake"
|
23
23
|
spec.add_dependency 'webmock'
|
24
24
|
spec.add_dependency 'minitest'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statement
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.6'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11
|
12
|
+
date: 2013-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rake
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -214,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
214
|
version: '0'
|
215
215
|
segments:
|
216
216
|
- 0
|
217
|
-
hash:
|
217
|
+
hash: 1791601295152230443
|
218
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
219
|
none: false
|
220
220
|
requirements:
|
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
segments:
|
225
225
|
- 0
|
226
|
-
hash:
|
226
|
+
hash: 1791601295152230443
|
227
227
|
requirements: []
|
228
228
|
rubyforge_project:
|
229
229
|
rubygems_version: 1.8.25
|