diff --git a/app/models/channel/twitter2.rb b/app/models/channel/twitter2.rb index ea098778c..8ee476fdd 100644 --- a/app/models/channel/twitter2.rb +++ b/app/models/channel/twitter2.rb @@ -21,7 +21,10 @@ class Channel::Twitter2 if channel[:options][:search] channel[:options][:search].each { |search| puts " - searching for #{search[:item]}" - tweets = @client.search( search[:item] ) + tweets = [] + client.search( search[:item], :count => 50, :result_type => "recent" ).collect do |tweet| + tweets.push tweet + end @article_type = 'twitter status' fetch_loop(tweets, channel, search[:group]) } @@ -30,7 +33,7 @@ class Channel::Twitter2 # mentions if channel[:options][:mentions] puts " - searching for mentions" - tweets = @client.mentions + tweets = @client.mentions_timeline @article_type = 'twitter status' fetch_loop(tweets, channel, channel[:options][:mentions][:group]) end diff --git a/test/unit/twitter_test.rb b/test/unit/twitter_test.rb index 271524678..0925fa0c2 100644 --- a/test/unit/twitter_test.rb +++ b/test/unit/twitter_test.rb @@ -91,8 +91,7 @@ class TwitterTest < ActiveSupport::TestCase config.access_token = user2_token config.access_token_secret = user2_token_secret end - tweets = client.search( hash ) - tweets.results.map do |tweet| + client.search(hash, :count => 50, :result_type => "recent").collect do |tweet| assert_equal( tweet.id, article.message_id ) end