Changeset 8290 for platform/pragger

Show
Ignore:
Timestamp:
03/23/08 12:23:07 (5 years ago)
Author:
yasuyuki
Message:

platform/pragger/Feed: 取得済み動画キャッシュの削除条件を、動画IDからアップロード時刻に変更 21
不要なソートを削除

Location:
platform/pragger/Feed
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • platform/pragger/Feed/nicovideo_feed.rb

    r8095 r8290  
    9999def save(config, items, return_items, raw_items, updated_at) 
    100100        if config['cache'] then 
    101           oldest_cache_item = items.size > 600 && return_items[600].link.scan(/\d+$/)[0].to_i 
    102                 cache_items = (items.size > 600) ? items.reject {|a, b| b.link.scan(/\d+$/)[0].to_i < oldest_cache_item} : items.dup 
     101          oldest_cache_item = items.size > 600 && return_items[600].date 
     102                cache_items = (items.size > 600) ? items.reject {|a, b| b.date < oldest_cache_item} : items.dup 
    103103                open( config['cache'], 'w' ) do |f| 
    104104                        YAML.dump(cache_items, f) 
  • platform/pragger/Feed/nicovideo_find.rb

    r7973 r8290  
    6262        # getting each tag pages 
    6363        config['tag'].each do |tag| 
    64                 (1..5).each do |count| 
     64                (1..4).each do |count| 
    6565                        retry_count = 0 
    6666                        uri = "#{nico}tag/#{CGI::escape( tag )}?page=#{count}&sort=f" 
  • platform/pragger/Feed/nicovideo_rank.rb

    r7992 r8290  
    3939        target_time = last_fetched - (target_hour * 60 * 60) 
    4040         
    41         raw_items.keys.sort{|a, b| a.scan(/\d+$/)[0].to_i <=> b.scan(/\d+$/)[0].to_i}.reverse.each do |key| 
     41        raw_items.keys.each do |key| 
    4242    begin 
    4343      raw_item = raw_items[key]