fluent-plugin-twitter 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
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.1"
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[:place])
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])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-twitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: