fluent-plugin-twitter 0.2.1 → 0.2.2
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.
- data/README.md +1 -1
- data/fluent-plugin-twitter.gemspec +1 -1
- data/lib/fluent/plugin/in_twitter.rb +5 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -29,7 +29,7 @@ gem install fluent-plugin-twitter
|
|
29
29
|
oauth_token_secret YOUR_OAUTH_TOKEN_SECRET # Required
|
30
30
|
tag input.twitter.sampling # Required
|
31
31
|
timeline sampling # Required (sampling or userstream)
|
32
|
-
keyword Ruby,Python # Optional (only work with `timeline` is sampling)
|
32
|
+
keyword Ruby,Python # Optional (currently, only work with `timeline` is sampling)
|
33
33
|
lang ja,en # Optional
|
34
34
|
output_format nest # Optional (nest or flat or simple[default])
|
35
35
|
</source>
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-twitter"
|
6
|
-
s.version = "0.2.
|
6
|
+
s.version = "0.2.2"
|
7
7
|
s.authors = ["Kentaro Yoshida"]
|
8
8
|
s.email = ["y.ken.studio@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/y-ken/fluent-plugin-twitter"
|
@@ -81,6 +81,10 @@ module Fluent
|
|
81
81
|
return false if !status.include?(:text)
|
82
82
|
return false if !status.include?(:user)
|
83
83
|
return false if (!@lang.nil? && @lang != '') && !@lang.include?(status[:user][:lang])
|
84
|
+
if @timeline == 'userstream' && (!@keyword.nil? && @keyword != '')
|
85
|
+
keyword_regexp = Regexp.new(keyword.gsub(',', '|'))
|
86
|
+
return false if !keyword_regexp.match(status[:text])
|
87
|
+
end
|
84
88
|
return true
|
85
89
|
end
|
86
90
|
|
@@ -95,7 +99,7 @@ module Fluent
|
|
95
99
|
record.store('message', status[:text])
|
96
100
|
record.store('geo', status[:geo])
|
97
101
|
record.store('place', status[:place])
|
98
|
-
record.store('created_at', status[:
|
102
|
+
record.store('created_at', status[:created_at])
|
99
103
|
record.store('user_name', status[:user][:name])
|
100
104
|
record.store('user_screen_name', status[:user][:screen_name])
|
101
105
|
record.store('user_profile_image_url', status[:user][:profile_image_url])
|