Skip to content

Instantly share code, notes, and snippets.

@craigw
Created July 20, 2009 19:18
Show Gist options
  • Save craigw/150546 to your computer and use it in GitHub Desktop.
Save craigw/150546 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'hpricot'
barking_iguana = URI.parse('http://barkingiguana.com/')
loop do
articles = Hpricot(Net::HTTP.get(barking_iguana))
title = (articles / "div.article a[@rel=bookmark] text()").first
link = (articles / "div.article a[@rel=bookmark]").first['href']
# Of course, this should have a real file path in it.
File.open("/.../.../.../barking_iguana.ssi", "w+") do |f|
f.write("#{title}: #{link}")
f.flush
end
sleep 900 # 15 minutes
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment