Class: TwitterFeedService
- Inherits:
-
Object
- Object
- TwitterFeedService
- Defined in:
- app/services/twitter_feed_service.rb
Instance Method Summary collapse
-
#get_feed_for_tag(tag) ⇒ Object
note: needed to remove trafficjamnet because of the bogus TRAF tweets they do.
-
#initialize ⇒ TwitterFeedService
constructor
A new instance of TwitterFeedService.
Constructor Details
#initialize ⇒ TwitterFeedService
Returns a new instance of TwitterFeedService.
3 4 5 6 |
# File 'app/services/twitter_feed_service.rb', line 3 def initialize # @client = Twitter::REST::Client.new(config) @client = $twitter_client end |
Instance Method Details
#get_feed_for_tag(tag) ⇒ Object
note: needed to remove trafficjamnet because of the bogus TRAF tweets they do
10 11 12 13 14 |
# File 'app/services/twitter_feed_service.rb', line 10 def get_feed_for_tag(tag) @client.search("##{tag} -rt -from:trafficjamnet", result_type: "recent", lang: "en").take(50).each do |tweet| Social::TwitterPostPresenter.from_twitter_post(tweet) end end |