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) newlink = follow_url(link)
if (newlink!=link) if (newlink!=link)
# puts "#{link} --> #{newlink}" # puts "#{link} --> #{newlink}"
begin
tweet.gsub!(link, newlink) tweet.gsub!(link, newlink)
rescue
puts "Encoding fsckup in #{newlink}"
end
end end
} }
row[3] = tweet row[3] = tweet