Skip to content

Instantly share code, notes, and snippets.

@seraphyn
Created January 31, 2012 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seraphyn/1709714 to your computer and use it in GitHub Desktop.
Save seraphyn/1709714 to your computer and use it in GitHub Desktop.
Octopress Rakefile-diff 1
27c27
< editor = ENV["EDITOR"] || "" # if environment variable $EDITOR is set, newly-created posts will automatically open for editing
---
>
112,114d111
< if #{editor}
< system "#{editor} #{filename}"
< end
361,392d357
< 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://seraphyn.teiko.org/sitemap.xml'))
< rescue LoadError
< puts '! Could not ping Google about our sitemap, because Net::HTTP or URI could not be found.'
< end
< end
<
< desc 'Ping pingomatic'
< task :pingomatic do
< begin
< require 'xmlrpc/client'
< puts '* Pinging ping-o-matic'
< XMLRPC::Client.new('rpc.pingomatic.com', '/').call('weblogUpdates.extendedPing', 'Seraphyn Blog' , 'http://seraphyn.teiko.org', 'http://seraphyn.teiko.org/atom.xml')
< rescue LoadError
< puts '! Could not ping ping-o-matic, because XMLRPC::Client could not be found.'
< end
< end
<
< Sitemap = "http://seraphyn.teiko.org/sitemap.xml"
< desc "ping search engines about a change in sitemap"
< task :ping do
< [ "http://www.google.com/webmasters/sitemaps/ping?sitemap=",
< "http://www.bing.com/webmaster/ping.aspx?siteMap=" ].each do |url|
< puts `curl #{url}#{Sitemap}`
< end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment