Updated to new twitter lib.

This commit is contained in:
Martin Edenhofer 2013-11-19 10:17:32 +01:00
parent b9dc843101
commit 5bc1fc9080
2 changed files with 6 additions and 4 deletions

View file

@ -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

View file

@ -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