Skip to content
Snippets Groups Projects
Commit 634bcf82 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

import

parent e4111156
No related branches found
No related tags found
No related merge requests found
......@@ -43,12 +43,13 @@ module WithFeaturedImage
def photo_import_pexels(id)
photo = Pexels::Client.new.photos.find id
url = photo.src['original']
url = "#{photo.src['original']}?auto=compress&cs=tinysrgb&w=2048"
filename = "#{photo.id}.png"
begin
file = URI.open url
featured_image.attach(io: file, filename: filename)
rescue
byebug
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment