Skip to content

A webservice to generate opengraph images based on an HTML template. Uses Docker, headless browser, and some other magic.

Notifications You must be signed in to change notification settings

simplecto/opengraph-image-as-a-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

This utility generates opengraph images.

How it works

the short version

Make an HTTP request to the endpoint, pass it some parameters, and it will return an image.

The long version

This is a webserver process

  1. HTTP request received
  2. Validate params
  3. Generate an HTML page from a tempalte + parameters
  4. Render that HTML page with a headless web browser
  5. Screenshot the page using headless browser
  6. Save that image out to a jpg
  7. Return the image

Using the service

Docker is probably the best way to kick the tires.

docker run --name ogaas --rm -p 8000:8000 -v $PWD/templates:/templates ogaas

That will get you going on port 8000

Creating your own templates

Everything should live in your template file (css and HTML). See the examples to see how it can work for you.

About

A webservice to generate opengraph images based on an HTML template. Uses Docker, headless browser, and some other magic.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages