Sha256: 473167818388966cae20528713df52a9331feb0297d347ca0292f8aea6a5dfec

Contents?: true

Size: 553 Bytes

Versions: 6

Compression:

Stored size: 553 Bytes

Contents

require "net/http"
require "cgi"

module Sitemap

  module Ping

    SEARCH_ENGINES = {
      "Google"  => "http://www.google.com/webmasters/tools/ping?sitemap=%s",
      "Ask.com" => "http://submissions.ask.com/ping?sitemap=%s",
      "Bing"    => "http://www.bing.com/webmaster/ping.aspx?siteMap=%s"
    }

    def self.send_request(file_path = false)
      SEARCH_ENGINES.each do |name, url|
        request = url % CGI.escape(file_path || Sitemap::Generator.instance.file_url)
        Net::HTTP.get(URI.parse(request))
      end
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sitemap-0.3.1 lib/sitemap/ping.rb
sitemap-0.3 lib/sitemap/ping.rb
sitemap-0.2 lib/sitemap/ping.rb
sitemap-0.2b2 lib/sitemap/ping.rb
sitemap-0.2b lib/sitemap/ping.rb
sitemap-0.1 lib/sitemap/ping.rb