Module: Yahoo::SE

Defined in:
lib/yahoo-se.rb,
lib/yahoo-se/ping.rb,
lib/yahoo-se/pages.rb,
lib/yahoo-se/result.rb,
lib/yahoo-se/inlinks.rb,
lib/yahoo-se/request.rb,
lib/yahoo-se/version.rb,
lib/yahoo-se/response.rb,
lib/yahoo-se/paginator.rb,
lib/yahoo-se/exceptions.rb,
lib/yahoo-se/update_notification.rb

Defined Under Namespace

Modules: Paginator Classes: ApplicationIDNotSet, Inlinks, Pages, Ping, Request, Response, ResponseError, Result, UpdateNotification

Constant Summary collapse

VERSION =
"1.1.0"
SERVICE_PATH =
"#{API_DOMAIN}/SiteExplorerService/#{VERSION}"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.application_idObject

Returns the value of attribute application_id.



9
10
11
# File 'lib/yahoo-se.rb', line 9

def application_id
  @application_id
end

Class Method Details

.all(obj) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/yahoo-se.rb', line 11

def all(obj)
  obj.options[:start] = 1
  obj.options[:results] = 100
  
  # First page of results
  results = obj.results
  
  if obj.total_results_available > 100
    # The rest of the page results
    begin
      (obj.total_results_available/100).ceil.times do |i|
        results += obj.next
      end
    rescue ResponseError => e
      # error output
    ensure
      results
    end
  end
  results
end

Shows the pages from other sites linking in to a page.

backlinks = Yahoo::SE.inlinks(“rubyskills.com”, :results => 100)

backlinks.results

backlinks.next



10
11
12
# File 'lib/yahoo-se/inlinks.rb', line 10

def self.inlinks(domain, options={})
  Yahoo::SE::Inlinks.new(domain, options)
end

.pages(domain, options = {}) ⇒ Object

Shows a list of all pages belonging to a domain in the Yahoo! index

page_data = Yahoo::SE.pages(“rubyskills.com”, :results => 100)

page_data.results

page_data.next



10
11
12
# File 'lib/yahoo-se/pages.rb', line 10

def self.pages(domain, options={})
  Yahoo::SE::Pages.new(domain, options)
end

.ping(sitemap) ⇒ Object

Allows you to notify Yahoo! of changes to your site. No appid required

ping = Yahoo::SE.pages(“rubyskills.com”)

ping.response

sitemap: The URL of the page to be submitted, or the URL of a feed containing site data.



10
11
12
# File 'lib/yahoo-se/ping.rb', line 10

def self.ping(sitemap)
  Yahoo::SE::Ping.new(sitemap)
end

.update_notification(url) ⇒ Object

The Update Notification service allows you to notify Yahoo! when your site changes. You may notify us about a single page, or a set of pages that need attention.

update_notification = Yahoo::SE.update_notification(“rubyskills.com”)

page_data.response

url: The URL of the page to be submitted, or the URL of a feed containing site data.



10
11
12
# File 'lib/yahoo-se/update_notification.rb', line 10

def self.update_notification(url)
  Yahoo::SE::UpdateNotification.new(url)
end