Skip to content

Instantly share code, notes, and snippets.

@superfeedr
Created August 19, 2010 15:46
Show Gist options
  • Select an option

  • Save superfeedr/538199 to your computer and use it in GitHub Desktop.

Select an option

Save superfeedr/538199 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'em-http'
require 'time'
#"{\"modified\":1282228860,\"etag\":\"NaTRM8p2KwPYAS3C82mbgEwF2QA\",\"period\":43200,\"entries_count\":0,\"url\":\"http://shannoncarlson.tumblr.com/rss\",\"last_maintenance_at\":1282229793}"
EventMachine.run {
http = EventMachine::HttpRequest.new('http://shannoncarlson.tumblr.com/rss').get :timeout => 10, :head => {'If-None-Match' => "NaTRM8p2KwPYAS3C82mbgEwF2QA", 'If-Modified-Since' => Time.at(1282228860).httpdate}, :redirects => 5
http.callback {
p http.response_header.status
p http.response_header
p http.response
EventMachine.stop
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment