Snippets

ESTI design compare titles

Created by Robert Poz last modified
1
2
3
4
5
6
7
8
9
#!/usr/bin/env ruby

require 'httparty'

CSV.parse(open(ARGV[0]).read)[1..-1].each do |url, title|
	page_title = HTTParty.get(url).
		scan(/<title>(.*?)<\/title>/).flatten.first
	puts "#{page_title.strip == title.strip} *** #{title} *** #{page_title}"
end

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.