Class: Crown::Hatena::Bookmark::EntryList

Inherits:
URIList
  • Object
show all
Defined in:
lib/crown/hatena/bookmark/entrylist.rb

Overview

————————————————————— #

EntryList

はてなブックマークの新着エントリー,または人気エントリー一覧
の各エントリー情報を取得するクラス.

————————————————————— #

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from URIList

#finish, #more?, #proxy_address, #proxy_port, #reset, #start

Constructor Details

#initialize(options = {}) ⇒ EntryList

———————————————————– #

initialize

———————————————————– #



54
55
56
57
# File 'lib/crown/hatena/bookmark/entrylist.rb', line 54

def initialize(options = {})
    super
    @interval = 30
end

Instance Attribute Details

#intervalObject

Returns the value of attribute interval.



49
50
51
# File 'lib/crown/hatena/bookmark/entrylist.rb', line 49

def interval
  @interval
end

Class Method Details

.start(options = {}, &block) ⇒ Object

———————————————————– #

EntryList.start

———————————————————– #



62
63
64
# File 'lib/crown/hatena/bookmark/entrylist.rb', line 62

def EntryList.start(options = {}, &block)
    Crown::Hatena::Bookmark::EntryList.new(options).start(&block)
end

Instance Method Details

#getObject

———————————————————– #

get

———————————————————– #



69
70
71
72
73
74
75
76
77
78
79
# File 'lib/crown/hatena/bookmark/entrylist.rb', line 69

def get()
    return get_summary(super()) if (!block_given?)
    while (more?)
        super().each { |entry|
            result = Crown::Hatena::Bookmark::Entry.new.summary(entry.uri,
                { :proxy_address => proxy_address(), :proxy_port => proxy_port() })
            yield result if (result != nil)
            sleep(@interval)
        }
    end
end