Skip to content

asny23/metacog

Repository files navigation

metacog

a tiny metadata retriever with metascraper

Usage

  1. Launch server.
  2. Request to server with site URL in url parameter.

Behavior

$ curl https://your-metacog-server/?url=https://github.com

returns

{
  "audio": null,
  "author": null,
  "date": "2025-01-01T00:00:00.000Z",
  "description": "Join the world’s most widely adopted, AI-powered developer platform where millions of developers, businesses, and the largest open source community build software that advances humanity.",
  "feed": null,
  "iframe": null,
  "image": "https://images.ctfassets.net/8aevphvgewt8/4UxhHBs2XnuyZ4lYQ83juV/b61529b087aeb4a318bda311edf4c345/home24.jpg",
  "lang": "en",
  "title": "GitHub · Build and ship software on a single, collaborative platform",
  "logo": "https://github.com/fluidicon.png",
  "publisher": "GitHub",
  "url": "https://github.com/",
  "video": null
}

Run locally

  • Requirements
    • Node.js 24.x
    • npm@11
$ npm i
$ npm run dev

Run locally with compose

  • Requirements
    • Docker Desktop or equivalent
$ docker compose up

Use container image

See Container registry

Build Docker image

$ docker build .

Configuration

environment variables:

  • PORT
    • Port to expose app
    • if undefined, 3000
  • REDIS_URL
    • Redis/Valkey host for caching
    • if undefined, memory cache is used
  • REDIS_TIMEOUT
    • Redis command timeout
    • in millisecond
  • ALLOWED_ORIGIN
    • Allowed origins for CORS
    • Write in space-delimited regular expressions
    • Access-Control-Allow-Origin
    • set blank for Access-Control-Allow-Origin: *
  • CACHE_TTL
    • Cache retention period for fetched data
    • in seconds
    • if undefined, 24hour
  • CACHE_CHECK
    • Effective only with memory cache
    • Cache expiration check interval
    • in seconds

Deploy to Render

Render Blueprints (IaC) – Render Docs

  1. Set up your account
  2. Edit render.yaml
  3. Commit & push
  4. Apply it in Render dashboard

Deploy to Fly.io

  1. Set up your account & app & cli
  2. $ flyctl redis create (if you use Redis)
  3. $ cp sample.fly.toml fly.toml
  4. Enter your app name in fly.toml
  5. $ npm run deploy

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages