Created
April 19, 2012 07:03
-
-
Save jamtur01/2419271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'jekyll' | |
LINK = "http://www.example.com" | |
desc 'Notify Twitter of a new post' | |
task :tweet do | |
puts '* Pinging Twitter about the latest post' | |
options = {} | |
options = Jekyll.configuration(options) | |
site = Jekyll::Site.new(options) | |
site.read_posts('.') | |
latest = site.posts.last | |
link = LINK + latest.to_liquid['url'] | |
title = latest.to_liquid['title'] | |
system("/usr/bin/t update 'New Post: #{title.chomp} #{link.chomp}'") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment