Generating pictures in code

Hello everyone! In this article I will tell you how we developed a solution to automate the generation of images from a template. First, there will be a case study and then the technical part of the solution.





Case study

It's no secret that social networks are a huge platform for finding an audience in order to positively highlight your material in the feed, make it recognizable and arousing the desire to click. you need to correctly format the tags on the page The Open Graph .





example with and without og installed
example with and without og installed

og , . og . . . . , , , . . charmer . .





, imageMagick , , . , . ImageMagick? .





imageMagick . , . . , .





imageMagick. - HTML.





HTML Headless browser .





Schematic diagram

rails ERB template. html headless browser, bash Kernel. . .





. sidekiq. chrome , , headless .





. , sidekiq , . . 20 50 , .





The ultimate goal was to create a tool that will allow you to solve the described problem quickly and reliably. When writing the code, the emphasis was on minimal configuration, thread safety, and ease of use. Sources are available on gitachba and the gem itself is available on rubygems. If for someone this gem will be useful and there are ideas and a desire to improve / fix it, I will gladly accept PR or comments) Thank you all who have read to the end!








All Articles