Simple open graph REST API based on open-graph-scrapper
Have you ever posted a hyperlink to Twitter, Facebook, or Slack and seen an image popup?
How did your social network know how to "unfurl" the URL and get an image?
The answer is in your <head>
.
The Open Graph protocol says you can put a <meta>
tag in the <head>
of a webpage to define this image.
- Run with vercel
vercel
- Send an HTTP GET to
https://<vercel_deploy_url>/api?url=<URL>
url
- url path for parse og tags
You'll want to fork this repository and deploy your own image generator.
- Click the fork button
- Clone the repo
git clone URL_OF_FORKED_REPO_HERE
- Change directory with
cd og.json
- Make changes
- Run locally with
vercel dev
and visit localhost:3000 (if nothing happens, runnpm install -g vercel
) - Deploy to the cloud by running
vercel
and you'll get a unique URL - Setup GitHub to autodeploy on push
- Alexander Katkov (7architect)