Skip to content

Instantly share code, notes, and snippets.

@andrei512
Created June 4, 2013 13:41
Show Gist options
  • Save andrei512/5706013 to your computer and use it in GitHub Desktop.
Save andrei512/5706013 to your computer and use it in GitHub Desktop.
the proper way to use source control
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
SITE = 'http://bunnyapprovesthesechanges.com/'
XPATH = '//*[@id="content"]/p'
doc = Nokogiri::HTML(open(SITE))
doc.xpath(XPATH).each do |node|
message = node.content
message = message.gsub(/[^a-zA-Z\ ]/,'').gsub(/ +/,' ')
system("git add .")
system("git ci -am #{message}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment