@pinkpixel/prysm-mcp
Version:
MCP server for the Prysm web scraper - enabling AI assistants to scrape web content
41 lines (36 loc) • 1.33 kB
JavaScript
/**
* Simple helper script for Prysm scraper
*
* This script forwards all arguments to the main scraper
* and provides a more intuitive way to run the scraper.
*/
// Just a wrapper around main_scraper.js to make the command more intuitive
const mainScraper = require('./main_scraper');
const args = process.argv.slice(2);
// Minimal logging function that uses stderr
function log(message) {
process.stderr.write(`${message}\n`);
}
// Check if help is needed
if (args.length === 0 || args.includes('--help')) {
log("Prysm - Structure-Aware Web Scraper");
log("\nUsage: node scrape.js [url] [options]");
log("\nOptions:");
log(" --pages <number> Number of links to follow from initial URL (default: 1)");
log(" --images Download images from the page");
log(" --output <path> Custom output path for results");
log(" --image-output <path> Custom output path for images");
log(" --help Show this help message");
log("\nExamples:");
log(' node scrape.js "https://example.com"');
log(' node scrape.js "https://example.com" --pages 5 --images');
process.exit(0);
}
// Pass all arguments to the main scraper
try {
mainScraper.main(args);
} catch (error) {
log(`Error: ${error.message}`);
process.exit(1);
}