read

Looking for a way to automate pinging Google and Bing with your updated Sitemap from the command line? Useful if you are running a Jekyll or Ruhoh blog....

The Code

require 'open-uri'

namespace :website do

  desc "Pings search engines with sitemap"
  task :ping_google do
    http = open("http://www.bing.com/webmaster/ping.aspx?siteMap=http://brandonparsons.me/sitemap.xml")
    http = open("http://www.google.com/webmasters/sitemaps/ping?sitemap=http://brandonparsons.me/sitemap.xml")
  end
end
Blog Logo

Brandon Parsons


Published

Image

Brandon Parsons

My Personal Blog

Head back to the main page