Looking for changes on website content https://projet-alice-demo.herokuapp.com/diffs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
388B

  1. #!./bin/rails runner
  2. Parallel.each Site.all, in_threads: 5 do |site|
  3. ActiveRecord::Base.transaction do
  4. print "Checking #{site.url.colorize :yellow}..."
  5. begin
  6. result = site.check
  7. color = case result
  8. when :new
  9. :blue
  10. when :changes
  11. :green
  12. end
  13. puts " #{result.to_s.colorize color}"
  14. rescue => e
  15. puts " #{e.to_s.colorize :red}"
  16. end
  17. end
  18. end