|
|
8 kuukautta sitten | |
|---|---|---|
| data | 8 kuukautta sitten | |
| docs | 8 kuukautta sitten | |
| scripts | 8 kuukautta sitten | |
| src | 8 kuukautta sitten | |
| web | 8 kuukautta sitten | |
| .env.example | 8 kuukautta sitten | |
| .gitignore | 8 kuukautta sitten | |
| .mcp-gogs.json | 8 kuukautta sitten | |
| CLAUDE.md | 8 kuukautta sitten | |
| README.md | 8 kuukautta sitten | |
| package-lock.json | 8 kuukautta sitten | |
| package.json | 8 kuukautta sitten | |
| tsconfig.json | 8 kuukautta sitten |
A TypeScript-based web scraper for extracting information from webshops with persistent storage, scheduled scraping, and change detection.
Clone and install:
git clone <repository-url>
cd webshop-scraper
npm install
Build:
npm run build
Configure environment:
# Basic Configuration
API_KEY=your-secret-key
PORT=3000
MAX_CONCURRENT_JOBS=3
# Qdrant Vector Search (Optional)
QDRANT_API_URL=http://localhost:6333
QDRANT_API_KEY=your-qdrant-key
# OpenRouter for Embeddings (Optional)
OPENROUTER_API_KEY=your-openrouter-key
OPENROUTER_MODEL=openai/text-embedding-3-large
# MCP Integration (Optional)
MCP_ENABLED=true
MCP_TRANSPORT=stdio
Start:
npm start
sudo ./scripts/install.sh
Reset the system to a clean state (creates backup first):
sudo ./scripts/reset.sh
Restore from a previous backup:
sudo ./scripts/restore.sh
What gets backed up:
Backups are stored in /var/backups/webshop-scraper/ with timestamps.
The system includes optional Qdrant vector search capabilities for semantic search of scraped content:
search_shipping_info(shop_id, query, limit?) - Search shipping and delivery informationsearch_contact_info(shop_id, query, limit?) - Search contact and support informationsearch_terms_info(shop_id, query, limit?) - Search terms of service and policiessearch_faq_info(shop_id, query, limit?) - Search frequently asked questionsSee the Qdrant Setup Guide for complete configuration instructions.
See API Documentation for complete endpoint reference. See Qdrant API Reference for vector search endpoints.
Create a scraping job:
curl -X POST http://localhost:3000/api/jobs \
-H "Authorization: Bearer your-secret-key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example-shop.com"}'
Get shop information:
curl http://localhost:3000/api/shops/:id \
-H "Authorization: Bearer your-secret-key"
Get shop results:
curl "http://localhost:3000/api/shops/:id/results?limit=10" \
-H "Authorization: Bearer your-secret-key"
# Development mode
npm run dev
# Watch mode
npm run watch
# Build
npm run build
Data is stored in data/shops.db (SQLite). The database includes:
View logs using journalctl:
sudo journalctl -u webshop-scraper -f
ISC