$ -weight: 500;">brew -weight: 500;">install node
-weight: 500;">brew -weight: 500;">install node
-weight: 500;">brew -weight: 500;">install node
-weight: 500;">curl -fsSL https://deb.nodesource.com/setup_20.x | -weight: 600;">sudo -E bash -
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y nodejs
-weight: 500;">curl -fsSL https://deb.nodesource.com/setup_20.x | -weight: 600;">sudo -E bash -
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y nodejs
-weight: 500;">curl -fsSL https://deb.nodesource.com/setup_20.x | -weight: 600;">sudo -E bash -
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y nodejs
node -v
-weight: 500;">npm -v
node -v
-weight: 500;">npm -v
node -v
-weight: 500;">npm -v
mkdir screenshot-tool
cd screenshot-tool
-weight: 500;">npm init -y
-weight: 500;">npm -weight: 500;">install puppeteer
mkdir screenshot-tool
cd screenshot-tool
-weight: 500;">npm init -y
-weight: 500;">npm -weight: 500;">install puppeteer
mkdir screenshot-tool
cd screenshot-tool
-weight: 500;">npm init -y
-weight: 500;">npm -weight: 500;">install puppeteer
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 \ libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 \ libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 \ libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 \ libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2
-weight: 600;">sudo -weight: 500;">apt-get -weight: 500;">install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 \ libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 \ libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2
const puppeteer = require('puppeteer'); const url = process.argv[2];
const output = process.argv[3] || 'screenshot.png'; if (!url) { console.error('Usage: node screenshot.js <url> [output-file]'); process.exit(1);
} (async () => { const browser = await puppeteer.launch({ headless: 'new', args: ['--no-sandbox', '---weight: 500;">disable-setuid-sandbox'], }); const page = await browser.newPage(); await page.setViewport({ width: 1280, height: 800 }); await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000, }); await page.screenshot({ path: output, fullPage: false }); await browser.close(); console.log(output);
})();
const puppeteer = require('puppeteer'); const url = process.argv[2];
const output = process.argv[3] || 'screenshot.png'; if (!url) { console.error('Usage: node screenshot.js <url> [output-file]'); process.exit(1);
} (async () => { const browser = await puppeteer.launch({ headless: 'new', args: ['--no-sandbox', '---weight: 500;">disable-setuid-sandbox'], }); const page = await browser.newPage(); await page.setViewport({ width: 1280, height: 800 }); await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000, }); await page.screenshot({ path: output, fullPage: false }); await browser.close(); console.log(output);
})();
const puppeteer = require('puppeteer'); const url = process.argv[2];
const output = process.argv[3] || 'screenshot.png'; if (!url) { console.error('Usage: node screenshot.js <url> [output-file]'); process.exit(1);
} (async () => { const browser = await puppeteer.launch({ headless: 'new', args: ['--no-sandbox', '---weight: 500;">disable-setuid-sandbox'], }); const page = await browser.newPage(); await page.setViewport({ width: 1280, height: 800 }); await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000, }); await page.screenshot({ path: output, fullPage: false }); await browser.close(); console.log(output);
})();
node screenshot.js https://screenshotrun.com test.png
node screenshot.js https://screenshotrun.com test.png
node screenshot.js https://screenshotrun.com test.png
<?php $url = 'https://screenshotrun.com';
$outputDir = __DIR__ . '/screenshots';
$filename = md5($url) . '.png';
$outputFile = $outputDir . '/' . $filename; $scriptPath = __DIR__ . '/../screenshot-tool/screenshot.js'; $command = sprintf( 'node %s %s %s 2>&1', escapeshellarg($scriptPath), escapeshellarg($url), escapeshellarg($outputFile)
); echo "Running: {$command}\n"; $output = shell_exec($command); if (file_exists($outputFile)) { echo "Done! Saved to: {$outputFile}\n"; echo "File size: " . round(filesize($outputFile) / 1024) . " KB\n";
} else { echo "Something went wrong.\n"; echo "Output: {$output}\n";
}
<?php $url = 'https://screenshotrun.com';
$outputDir = __DIR__ . '/screenshots';
$filename = md5($url) . '.png';
$outputFile = $outputDir . '/' . $filename; $scriptPath = __DIR__ . '/../screenshot-tool/screenshot.js'; $command = sprintf( 'node %s %s %s 2>&1', escapeshellarg($scriptPath), escapeshellarg($url), escapeshellarg($outputFile)
); echo "Running: {$command}\n"; $output = shell_exec($command); if (file_exists($outputFile)) { echo "Done! Saved to: {$outputFile}\n"; echo "File size: " . round(filesize($outputFile) / 1024) . " KB\n";
} else { echo "Something went wrong.\n"; echo "Output: {$output}\n";
}
<?php $url = 'https://screenshotrun.com';
$outputDir = __DIR__ . '/screenshots';
$filename = md5($url) . '.png';
$outputFile = $outputDir . '/' . $filename; $scriptPath = __DIR__ . '/../screenshot-tool/screenshot.js'; $command = sprintf( 'node %s %s %s 2>&1', escapeshellarg($scriptPath), escapeshellarg($url), escapeshellarg($outputFile)
); echo "Running: {$command}\n"; $output = shell_exec($command); if (file_exists($outputFile)) { echo "Done! Saved to: {$outputFile}\n"; echo "File size: " . round(filesize($outputFile) / 1024) . " KB\n";
} else { echo "Something went wrong.\n"; echo "Output: {$output}\n";
}
<?php function takeScreenshot( string $url, string $outputDir, int $width = 1280, int $height = 800, bool $fullPage = false
): ?string { $filename = md5($url . $width . $height . ($fullPage ? '1' : '0')) . '.png'; $outputFile = rtrim($outputDir, '/') . '/' . $filename; $scriptPath = __DIR__ . '/../screenshot-tool/screenshot.js'; $command = sprintf( 'node %s %s %s %d %d %s 2>&1', escapeshellarg($scriptPath), escapeshellarg($url), escapeshellarg($outputFile), $width, $height, $fullPage ? 'true' : 'false' ); shell_exec($command); return file_exists($outputFile) ? $outputFile : null;
} // Desktop screenshot
$file = takeScreenshot('https://screenshotrun.com', __DIR__ . '/screenshots');
echo $file ? "Desktop: {$file}\n" : "Failed\n"; // Mobile (iPhone-sized)
$file = takeScreenshot('https://screenshotrun.com', __DIR__ . '/screenshots', 375, 812);
echo $file ? "Mobile: {$file}\n" : "Failed\n"; // Full page with scrolling
$file = takeScreenshot('https://screenshotrun.com', __DIR__ . '/screenshots', 1280, 800, true);
echo $file ? "Full page: {$file}\n" : "Failed\n";
<?php function takeScreenshot( string $url, string $outputDir, int $width = 1280, int $height = 800, bool $fullPage = false
): ?string { $filename = md5($url . $width . $height . ($fullPage ? '1' : '0')) . '.png'; $outputFile = rtrim($outputDir, '/') . '/' . $filename; $scriptPath = __DIR__ . '/../screenshot-tool/screenshot.js'; $command = sprintf( 'node %s %s %s %d %d %s 2>&1', escapeshellarg($scriptPath), escapeshellarg($url), escapeshellarg($outputFile), $width, $height, $fullPage ? 'true' : 'false' ); shell_exec($command); return file_exists($outputFile) ? $outputFile : null;
} // Desktop screenshot
$file = takeScreenshot('https://screenshotrun.com', __DIR__ . '/screenshots');
echo $file ? "Desktop: {$file}\n" : "Failed\n"; // Mobile (iPhone-sized)
$file = takeScreenshot('https://screenshotrun.com', __DIR__ . '/screenshots', 375, 812);
echo $file ? "Mobile: {$file}\n" : "Failed\n"; // Full page with scrolling
$file = takeScreenshot('https://screenshotrun.com', __DIR__ . '/screenshots', 1280, 800, true);
echo $file ? "Full page: {$file}\n" : "Failed\n";
<?php function takeScreenshot( string $url, string $outputDir, int $width = 1280, int $height = 800, bool $fullPage = false
): ?string { $filename = md5($url . $width . $height . ($fullPage ? '1' : '0')) . '.png'; $outputFile = rtrim($outputDir, '/') . '/' . $filename; $scriptPath = __DIR__ . '/../screenshot-tool/screenshot.js'; $command = sprintf( 'node %s %s %s %d %d %s 2>&1', escapeshellarg($scriptPath), escapeshellarg($url), escapeshellarg($outputFile), $width, $height, $fullPage ? 'true' : 'false' ); shell_exec($command); return file_exists($outputFile) ? $outputFile : null;
} // Desktop screenshot
$file = takeScreenshot('https://screenshotrun.com', __DIR__ . '/screenshots');
echo $file ? "Desktop: {$file}\n" : "Failed\n"; // Mobile (iPhone-sized)
$file = takeScreenshot('https://screenshotrun.com', __DIR__ . '/screenshots', 375, 812);
echo $file ? "Mobile: {$file}\n" : "Failed\n"; // Full page with scrolling
$file = takeScreenshot('https://screenshotrun.com', __DIR__ . '/screenshots', 1280, 800, true);
echo $file ? "Full page: {$file}\n" : "Failed\n";
<?php $apiKey = 'YOUR_API_KEY'; $ch = curl_init('https://screenshotrun.com/api/v1/screenshots');
curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'url' => 'https://screenshotrun.com', 'format' => 'png', 'block_cookies' => true, ]), CURLOPT_RETURNTRANSFER => true,
]); $response = json_decode(curl_exec($ch), true);
curl_close($ch); echo "Screenshot ID: " . $response['data']['id'];
<?php $apiKey = 'YOUR_API_KEY'; $ch = curl_init('https://screenshotrun.com/api/v1/screenshots');
curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'url' => 'https://screenshotrun.com', 'format' => 'png', 'block_cookies' => true, ]), CURLOPT_RETURNTRANSFER => true,
]); $response = json_decode(curl_exec($ch), true);
curl_close($ch); echo "Screenshot ID: " . $response['data']['id'];
<?php $apiKey = 'YOUR_API_KEY'; $ch = curl_init('https://screenshotrun.com/api/v1/screenshots');
curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'url' => 'https://screenshotrun.com', 'format' => 'png', 'block_cookies' => true, ]), CURLOPT_RETURNTRANSFER => true,
]); $response = json_decode(curl_exec($ch), true);
curl_close($ch); echo "Screenshot ID: " . $response['data']['id'];