Encoding error handling in expandlinks

This commit is contained in:
Blog cron job 2017-09-21 08:33:28 +02:00
parent 4e683308ac
commit 6f592eddb2

View file

@ -57,7 +57,11 @@ CSV.open(ARGV[1], 'wb') do |out|
newlink = follow_url(link)
if (newlink!=link)
# puts "#{link} --> #{newlink}"
tweet.gsub!(link, newlink)
begin
tweet.gsub!(link, newlink)
rescue
puts "Encoding fsckup in #{newlink}"
end
end
}
row[3] = tweet