Skip to content

Instantly share code, notes, and snippets.

@leafduo
Created July 30, 2012 14:52
Show Gist options
  • Select an option

  • Save leafduo/3207505 to your computer and use it in GitHub Desktop.

Select an option

Save leafduo/3207505 to your computer and use it in GitHub Desktop.
Disqus migration
list = File.open('old.cvs')
list.each do |line|
new_path = `find . -iname "*#{line.split('/')[-2]}.html"`
new_path.slice!(0...2)
new_path.slice!(".html")
new_path[4] = new_path[7] = new_path[10] = '/'
new_path.strip!
new_path = "http://testing.leafduo.com/#{new_path}/"
puts "#{line.strip}, #{new_path}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment