Class: YahooSiteExplorer
- Inherits:
-
Object
- Object
- YahooSiteExplorer
- Defined in:
- lib/yahoo_site_explorer.rb,
lib/yahoo_site_explorer/api.rb,
lib/yahoo_site_explorer/result.rb,
lib/yahoo_site_explorer/backlinks.rb,
lib/yahoo_site_explorer/page_data.rb,
lib/yahoo_site_explorer/results_container.rb
Overview
Provides a Ruby interface ot the Yahoo! Site Explorer web service.
Defined Under Namespace
Classes: API, Backlinks, PageData, Result, ResultsContainer
Instance Method Summary collapse
-
#backlinks(url, options = {}) ⇒ Object
Queries Yahoo! Site Explorer for backlinks (inlink data) to the given URL.
-
#initialize(appid) ⇒ YahooSiteExplorer
constructor
A new instance of YahooSiteExplorer.
-
#page_data(url, options = {}) ⇒ Object
Queries Yahoo! Site Explorer for page data on the given URL.
Constructor Details
#initialize(appid) ⇒ YahooSiteExplorer
Returns a new instance of YahooSiteExplorer.
12 13 14 |
# File 'lib/yahoo_site_explorer.rb', line 12 def initialize(appid) @appid = appid end |
Instance Method Details
#backlinks(url, options = {}) ⇒ Object
Queries Yahoo! Site Explorer for backlinks (inlink data) to the given URL.
Example
yahoo_site_explorer.backlinks('http://www.yahoo.com', :results => 50)
Options
The following options would be passed into the method as a symbolized key and value pair.
- results
-
The number of results to return. Default: 50. Maximum: 100.
- start
-
The starting result position to return. The finishing position cannot exceed 1000. Default: 1.
- entire_site
-
Specifies whether to provide results for the entire site, or just the page referenced by the query. If the query is not a domain URL (i.e. it contains path information, such as smallbusiness.yahoo.com/webhosthing/), this parameter has no effect. Default: no value. Other possible values: ‘1’
- omit_inlinks
-
If specified, inlinks will not be returned if they are from pages in the same domain/subdomain as the requested page. Default: ‘none’ Other possible values: ‘domain’, ‘subdomain’
54 55 56 57 |
# File 'lib/yahoo_site_explorer.rb', line 54 def backlinks(url, = {}) [:query] ||= url Backlinks.new(self, , api.inlink_data()) end |
#page_data(url, options = {}) ⇒ Object
Queries Yahoo! Site Explorer for page data on the given URL.
Example
yahoo_site_explorer.page_data('http://www.yahoo.com', :results => 50)
Options
The following options would be passed into the method as a symbolized key and value pair.
- results
-
The number of results to return. Default: 50. Maximum: 100.
- start
-
The starting result position to return. The finishing position cannot exceed 1000. Default: 1.
- domain_only
-
Specifies whether to provide results for all subdomains (such as search.yahoo.com for www.yahoo.com) of the domain query, or just the specifically requested domain. If the query is not a domain URL (i.e. it contains path information, such as smallbusiness.yahoo.com/webhosting/), this parameter has not affect. Default: no value Other possible values: ‘1’
91 92 93 94 |
# File 'lib/yahoo_site_explorer.rb', line 91 def page_data(url, = {}) [:query] ||= url PageData.new(self, , api.page_data()) end |