Skip to content

Instantly share code, notes, and snippets.

View pgirzalsky's full-sized avatar

Philipp Girzalsky pgirzalsky

View GitHub Profile
@pgirzalsky
pgirzalsky / Screenshot based on Sitemap XML
Last active January 13, 2025 17:35
Save website screenshots in bulk
// The script requires Node.js to run. Install Node.js here https://nodejs.org/en/download/prebuilt-installer
// It also requires a XML sitemap to exist at https://example.com/sitemap.xml
// To start the script, open the file in your fav IDE, open the terminal and use: node screenshot.js {your url (e.g., https://example.com)}
// Don't forget to insert your API key below
// If you get an error saying "Error: Cannot find module", make sure you open the script in a workspace
// In VS Code, go to "File" > "Open Folder" | https://code.visualstudio.com/docs/editor/workspaces
// API key from https://apiflash.com/ (replace with your actual key)
const API_KEY = "your_apiflash_api_key_here";