tan
2 hours ago · Tech · 0 comments

Apple documentation websites are fully dynamic. Simply saving a page won't show any content. So I wrote a script to archive Apple Documentation Archive offline. It's a node.js program. It will take few days around three or so to complete the download. It is recommended to run this in one go. // Script to download Apple Documentation Archive for offline viewing. // Run the program using: // $ node main.js // To fetching a specific page and linked resources the link can be specified // as command line arg. It takes a single url or multiple comma separated urls. // $ node main.js https://url, https://url2 // If url is not specified, it takes the one in the program. // // Thu 08 Jan 26 - Jaseem V V import fetch from "node-fetch"; import { JSDOM } from "jsdom"; import fs from "fs-extra"; import path from "path"; import mime from "mime-types"; import { URL } from "url"; const DEFAULT_START_URLS = JSON.parse( fs.readFileSync(new URL("./urls.json", import.meta.url), "utf-8") ).urls; const…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.