yohns/meta-generator

AI-powered meta description and keyword generator supporting Gemini and Claude.

Maintainers

Package info

github.com/YoBuild/Meta-Generator

pkg:composer/yohns/meta-generator

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-03-16 00:19 UTC

This package is auto-updated.

Last update: 2026-03-16 00:26:41 UTC


README

AI-powered meta description and keyword generator. Paste a content blurb and get an SEO-ready meta description (120-160 characters) and a set of 5-8 keywords — powered by Google Gemini or Anthropic Claude.

Requirements

  • PHP 8.2+
  • Extensions: curl, json, mbstring
  • Composer
  • A Gemini or Claude API key

Installation

composer install
cp config/ai.example.php config/ai.php

Edit config/ai.php and add your API key:

'provider' => 'gemini', // or 'claude'

'gemini' => [
    'api_key' => 'YOUR_KEY_HERE',
    'model'   => 'gemini-2.0-flash',
],

'claude' => [
    'api_key' => 'YOUR_KEY_HERE',
    'model'   => 'claude-haiku-4-5-20251001',
],

Then serve the project from any PHP-capable web server (Apache, Nginx, Laragon, etc.) and open index.html.

Usage

  1. Open the app in your browser
  2. Paste or type a content blurb (up to 2000 characters)
  3. Click Generate
  4. Copy the resulting meta description or keywords

API Endpoint

POST /api/generate-meta.php
Content-Type: application/json

{"blurb": "Your content blurb here..."}

Response:

{
    "success": true,
    "provider": "gemini",
    "data": {
        "meta_description": "...",
        "keywords": ["keyword1", "keyword2", "..."]
    }
}

Rate Limiting

Rate limiting is enabled by default in the config (per IP):

'rate_limit' => [
    'enabled'      => true,
    'rpm'          => 5,   // Requests Per Minute
    'rpd'          => 20,  // Requests Per Day
    'storage_path' => __DIR__ . '/../storage/rate_limit.json',
],

The storage_path is configurable — point it to any writable location. The directory is created automatically on first request.

Adding a Provider

  1. Create a class in src/MetaGenerator/ extending AbstractMetaGenerator
  2. Implement the generate(string $blurb): array method
  3. Add a case to MetaGeneratorFactory::make()
  4. Add the provider's config block to config/ai.example.php

License

MIT