Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (22 sloc) 798 Bytes
task :default => :dev
desc 'Ping pingomatic'
task :pingomatic do
begin
require 'xmlrpc/client'
puts '* Pinging ping-o-matic'
XMLRPC::Client.new('rpc.pingomatic.com', '/').call('weblogUpdates.extendedPing', 'Example' , 'http://example.com', 'http://example.com/atom.xml')
rescue LoadError
puts '! Could not ping ping-o-matic, because XMLRPC::Client could not be found.'
end
end
desc 'Notify Google of the new sitemap'
task :sitemap do
begin
require 'net/http'
require 'uri'
puts '* Pinging Google about our sitemap'
Net::HTTP.get('www.google.com', '/webmasters/tools/ping?sitemap=' + URI.escape('http://example.com/sitemap.xml'))
rescue LoadError
puts '! Could not ping Google about our sitemap, because Net::HTTP or URI could not be found.'
end
end