Class: TermExtraction::Yahoo
Instance Attribute Summary
#api_key, #context
Class Method Summary
collapse
Instance Method Summary
collapse
#canonical_name, #initialize
Constructor Details
This class inherits a constructor from TermExtraction
Class Method Details
.canonical_name ⇒ Object
30
31
32
|
# File 'lib/term_extraction/yahoo.rb', line 30
def canonical_name
'yahoo'
end
|
Instance Method Details
#terms ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/term_extraction/yahoo.rb', line 8
def terms
terms = []
data = Nokogiri::XML.parse(remote_xml)
unless data.nil?
data.search('//s:Result', ns).each do |n|
terms << n.text
end
end
terms
end
|
#uri ⇒ Object
21
22
23
24
25
26
27
|
# File 'lib/term_extraction/yahoo.rb', line 21
def uri
api_uri = Addressable::URI.parse(gateway)
api_uri.query_values = {
'q' => "select * from search.termextract where context=\"#{@context}\""
}
api_uri
end
|