Class: Daylife::Search

Inherits:
API
  • Object
show all
Defined in:
lib/daylife/search.rb

Overview

See developer.daylife.com/docs/Search_Syntax for details on search query syntax.

Class Method Summary collapse

Methods inherited from API

auth, get, #initialize, methodize

Constructor Details

This class inherits a constructor from Daylife::API

Class Method Details

.core_identifierObject



5
6
7
# File 'lib/daylife/search.rb', line 5

def self.core_identifier
  return :query
end

.get_counts(query, parameters = {}) ⇒ Object

This method is used to retrieve number of mentions in news for the given query.



39
40
41
# File 'lib/daylife/search.rb', line 39

def self.get_counts(query, parameters={})
  get :get_counts, parameters.merge(:query => query)
end

.get_matching_topics(query, parameters = {}) ⇒ Object

This method is used to retrieve references to Daylife topics whose names match with the given query term. For example, to find the Condoleezza Rice topic, you could use query = Condoleezza.



17
18
19
# File 'lib/daylife/search.rb', line 17

def self.get_matching_topics(query, parameters={})
  get :get_matching_topics, parameters.merge(:query => query)
end

Returns articles that contain the given query term.



10
11
12
# File 'lib/daylife/search.rb', line 10

def self.get_related_articles(query, parameters={})
  get :get_related_articles, parameters.merge(:query => query)
end

This method is used to retrieve images related to articles that contain the given query term.



34
35
36
# File 'lib/daylife/search.rb', line 34

def self.get_related_images(query, parameters={})
  get :get_related_images, parameters.merge(:query => query)
end

This method is used to retrieve quotes from articles that contain the given query term.



29
30
31
# File 'lib/daylife/search.rb', line 29

def self.get_related_quotes(query, parameters={})
  get :get_related_quotes, parameters.merge(:query => query)
end

This method is used to retrieve references to Daylife topics that have appeared in articles containing the given query term. To find specifically named topics, use the self.get_matching_topics method call.



24
25
26
# File 'lib/daylife/search.rb', line 24

def self.get_related_topics(query, parameters={})
  get :get_related_topics, parameters.merge(:query => query)
end