Class KizAPI::ChannelWords
In: lib/kizapi.rb
Parent: Array

ChannelWords is a class for fetching co-occurrence channel words of a keyword.

Methods

day   month   new   week  

Classes and Modules

Class KizAPI::ChannelWords::Word

Attributes

date  [R]  published date
keyword  [R] 
span  [R] 

Public Class methods

Same as ChannelWords.new(keyword, "24").

[Source]

     # File lib/kizapi.rb, line 152
152:     def self.day(keyword)
153:       new(keyword, "24")
154:     end

Same as ChannelWords.new(keyword, "1m").

[Source]

     # File lib/kizapi.rb, line 162
162:     def self.month(keyword)
163:       new(keyword, "1m")
164:     end

Make a list of co-occurrence channel words of a keyword.

keyword:keyword in UTF-8
span:"24", "1w", or "1m"

[Source]

     # File lib/kizapi.rb, line 139
139:     def initialize(keyword, span="24")
140:       @keyword = keyword
141:       @span = span
142:       uri = URI.parse(URI.escape("http://kizasi.jp/kizapi.py?span=\#{span}&kw_expr=\#{keyword}&type=channel\n".chomp))
143:       rss = RSS::Parser.parse(uri.read, true, false)
144:       @date = rss.channel.lastBuildDate
145:       super(rss.items.map{|item| Word.new(item)})
146:     end

Same as ChannelWords.new(keyword, "1w").

[Source]

     # File lib/kizapi.rb, line 157
157:     def self.week(keyword)
158:       new(keyword, "1w")
159:     end

[Validate]