forked from jeherve/jekyll-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
24 lines (22 loc) · 798 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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