Skip to content

Instantly share code, notes, and snippets.

@jamtur01
Created April 19, 2012 07:03
Show Gist options
  • Save jamtur01/2419271 to your computer and use it in GitHub Desktop.
Save jamtur01/2419271 to your computer and use it in GitHub Desktop.
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