comparison app/models/tweet.rb @ 100:c1d5d8be92c6

Add support for extended tweets
author nanaya <me@myconan.net>
date Fri, 23 Sep 2016 23:02:16 +0900
parents ff5557f9902c
children de342c5df747
comparison
equal deleted inserted replaced
99:56fd4829e599 100:c1d5d8be92c6
7 start_client_config_id = @client_config_id 7 start_client_config_id = @client_config_id
8 8
9 begin 9 begin
10 @timeline ||= 10 @timeline ||=
11 Rails.cache.fetch({ :timeline => @twitter_id }, :expires_in => cache_expires_time) do 11 Rails.cache.fetch({ :timeline => @twitter_id }, :expires_in => cache_expires_time) do
12 @client.user_timeline(@twitter_id, :count => 40, :exclude_replies => false, :include_rts => true) 12 @client.user_timeline(@twitter_id, :count => 40, :exclude_replies => false, :include_rts => true, :tweet_mode => :extended)
13 end 13 end
14 rescue Twitter::Error::TooManyRequests 14 rescue Twitter::Error::TooManyRequests
15 next_client_config_id = @client_config_id + 1 15 next_client_config_id = @client_config_id + 1
16 init_client next_client_config_id 16 init_client next_client_config_id
17 17