Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kocal/open-graph-image-generator
Symfony project to dynamically generate a OpenGraph image given an URL
https://github.com/kocal/open-graph-image-generator
image opengraph php symfony
Last synced: about 4 hours ago
JSON representation
Symfony project to dynamically generate a OpenGraph image given an URL
- Host: GitHub
- URL: https://github.com/kocal/open-graph-image-generator
- Owner: Kocal
- Created: 2023-11-14T20:50:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-10T20:44:06.000Z (7 months ago)
- Last Synced: 2024-10-12T23:12:56.688Z (about 1 month ago)
- Topics: image, opengraph, php, symfony
- Language: PHP
- Homepage:
- Size: 1.75 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Open Graph Image Generator
This project is a simple Open Graph image generator, it allows you to generate Open Graph images for a given URL.
## Requirements
- [Symfony CLI](https://symfony.com/download)
- Docker and Docker Compose
- PHP 8.3## Installation
1. Clone the repository and configure the environment:
```shell
git clone https://github.com/Kocal/open-graph-image-generator.git
cd open-graph-image-generator
symfony local:server:ca:install
symfony local:proxy:domain:attach og-image-generator
```2. Edit the `.env.local` and configure `APP_OPENGRAPH_IMAGE_GENERATION_ALLOWED_DOMAINS` to allow your domain(s) to generate Open Graph images.
3. Install the dependencies with Composer:
```shell
$ symfony composer install
```## Usage
Run the project:
```shell
$ docker compose up -d
$ symfony serve
```## Programmatic usage
You can use this project programmatically by sending a `GET` request to the `/generate` endpoint with the following parameters:
- `format` (required): The image format, can be `html` or `image`
- `url` (required): The URL to generate the Open Graph imageExample: https://127.0.0.1:8000/generate?url=https://hugo.alliau.me/posts/2023-10-21-blackfire-and-symfony-cli.html&format=image