Created
March 13, 2013 15:47
-
-
Save haifeng/5153408 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 'http-request' | |
require 'http' | |
require 'benchmark' | |
urls = [ | |
"http://www.lovelygirliebits.com/feeds/posts/default", | |
"http://www.51arch.com/feed/", | |
"http://mutelife.com/feed/", | |
"http://jacksonphillipsinc.com/Tools_of_Trade/Tools_of_the_Trade.xml", | |
"http://hrishimittal.com/rss", | |
"http://learninginnovation.adampalin.co.uk/feed/", | |
"http://octave.dk/feed/", | |
"http://insurancesearch101.com/rss", | |
"http://www.87am.com/rss", | |
"http://www.zumios.com/feed/", | |
"http://adviso.hr/feed/", | |
"http://comofas.com/rss", | |
"http://feeds2.feedburner.com/shaunv", | |
"http://feedproxy.google.com/TechCrunch", | |
"http://gothamconsultancy.moonfruit.com/feeds/blogposts", | |
"http://kruzo.dk/rss", | |
"http://feeds.feedburner.com/scmagazinehome", | |
"http://montreal.kijiji.ca/f-SearchAdRss", | |
"http://blog.alezaa.com/rss", | |
"http://www.tecdencias.com/wp26/", | |
"http://www.ilmareunisce.com/feed/", | |
"http://rss.golem.de/rss.php", | |
"http://www.bizbash.com/rss/news.xml", | |
"http://www.heartwoodfarms.com/feed", | |
"http://homepage.blogs.sapo.pt/data/rss", | |
"http://fuckyeahgaming.com/feed/", | |
"http://www.zaudhaus.com/feed/", | |
"http://cts.tradepub.com/cts4/", | |
"http://www.cuponidad.com.pe/rssfeed.aspx", | |
"http://www.digitalgist.com/feeds/posts/default" | |
] | |
url = urls.last | |
p url | |
p HttpRequest.get(url) | |
p "===" | |
p Http.with_response(:object).with_follow(true).get("http://github.com", "User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17").body | |
# Benchmark::bm(10) do |x| | |
# x.report("http-request") do | |
# urls.each do |url| | |
# HttpRequest.get(url) | |
# end | |
# end | |
# x.report("http-tony") do | |
# urls.each do |url| | |
# Http.get(url) | |
# end | |
# end | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment