Updated to new twitter lib.
This commit is contained in:
parent
b9dc843101
commit
5bc1fc9080
2 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue