X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ad0e7b2c224aa69b9ea5d3c14643745c75a66288..4c2fa6c44180c1885fd8d0dfbf0f58258aea618c:/script/gravatar diff --git a/script/gravatar b/script/gravatar index e14e7ea0e..59ecff4f8 100755 --- a/script/gravatar +++ b/script/gravatar @@ -4,8 +4,9 @@ start = 0 User.where("image_use_gravatar AND id >=" + start.to_s).order("id").find_each do |user| - p "checked up to id " + user.id.to_s if user.id % 1000 == 0 # just give a rough indication where we are for restarting + p "checked up to id " + user.id.to_s if (user.id % 1000).zero? # just give a rough indication where we are for restarting next if user.image.present? + hash = Digest::MD5.hexdigest(user.email.downcase) url = "https://www.gravatar.com/avatar/#{hash}?d=404" # without d=404 we will always get an image back response = OSM.http_client.get(URI.parse(url))