a tiny metadata retriever with metascraper
- Launch server.
- Request to server with site URL in urlparameter.
$ 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
}- Requirements
- Node.js 24.x
- npm@11
 
$ npm i
$ npm run dev- Requirements
- Docker Desktop or equivalent
 
$ docker compose up$ docker build .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
- Set up your account
- Edit render.yaml
- Commit & push
- Apply it in Render dashboard
Deploy to Fly.io
- Set up your account & app & cli
- $ flyctl redis create(if you use Redis)
- $ cp sample.fly.toml fly.toml
- Enter your app name in fly.toml
- $ npm run deploy