@mxfb/cli 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxfb/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "author": "Maxime Fabas",
6
6
  "license": "ISC",
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import h from"node:process";import{Command as f,InvalidArgumentError as b}from"commander";import{input as w}from"@inquirer/prompts";import{styles as e}from"@design-edito/tools/agnostic/misc/logs/styles/index.js";import{crawlBlog as $,readArchivePosts as y}from"@mxfb/tools/node/scrapers/@tumblr/index.js";var v=500;function g(o){let t=Number.parseInt(o,10);if(Number.isNaN(t)||t<=0)throw new b("Expected a positive number.");return t}function n(o,t){return`${o} ${t}${o===1?"":"s"}`}function P(o){let{url:t,kind:c,postCount:i,newPostCount:a,error:p}=o;if(p!==null){console.log(e.warning(`${"failed".padEnd(10)}${t}`)),console.log(e.light(` ${p}`));return}let d=a===i?n(i,"post"):`${n(i,"post")}, ${a} new`;console.log(`${e.light((c??"unknown").padEnd(10))}${t}`),console.log(e.light(` ${d}`))}var m=new f().name("scrape-tumblr").description("Archives a Tumblr blog: every page it serves, every post it holds.").argument("[blog-url]","any URL on the blog \u2014 only its origin is used").option("-d, --data-dir <path>","where to write, and where to resume from").option("-l, --limit <count>","stop after this many pages",g).option("--delay <ms>","wait between two requests",g,v).option("-r, --resume","pick up where a previous crawl of the same directory stopped",!1).option("--no-sitemap","walk the listings instead of reading the sitemap").option("-q, --quiet","report only the result",!1).parse(),s=m.opts(),[C]=m.args,l=C??await w({message:"Which blog should be scraped?",default:"https://example.tumblr.com"});l.trim()===""&&(console.log(e.error("No blog to scrape.")),h.exit(1));console.log("");console.log(e.title(`Scraping ${l}...`));console.log(e.light("> starting a headless browser, the blog host refuses plain requests"));console.log("");var r=await $(l,{dataDirPath:s.dataDir,limit:s.limit,delayMs:s.delay,resume:s.resume,useSitemap:s.sitemap,onPageCrawled:s.quiet?void 0:P}),u=await y(r.dataDirPath),D=u.filter(o=>o.publishedOn!==null).length,A=u.filter(o=>o.rawHtml!==null).length;console.log("");console.log(e.title("Scrape complete."));console.log(e.important(r.blog?.title??l));console.log(e.success(`${n(r.pageCount,"page")} read, ${n(r.postCount,"post")} found`));console.log(e.light(`${D} with a date, ${A} with their markup kept`));r.failures.length>0&&console.log(e.warning(`${n(r.failures.length,"page")} could not be read`));console.log(e.info(`
3
- Archive`));console.log(e.light(r.dataDirPath));console.log(e.info(`
4
- Resume`));console.log(e.light(`> scrape-tumblr ${l} --data-dir ${r.dataDirPath} --resume`));console.log("");
2
+ import{mkdir as D}from"node:fs/promises";import g from"node:os";import h from"node:path";import f from"node:process";import{Command as A,InvalidArgumentError as U}from"commander";import{input as w,select as C}from"@inquirer/prompts";import{styles as t}from"@design-edito/tools/agnostic/misc/logs/styles/index.js";import{crawlBlog as E,readArchivePosts as R}from"@mxfb/tools/node/scrapers/@tumblr/index.js";var k=500;function p(e){let o=Number.parseInt(e,10);if(Number.isNaN(o)||o<=0)throw new U("Expected a positive number.");return o}function a(e,o){return`${e} ${o}${e===1?"":"s"}`}function b(e){let o=e.trim();if(o==="")return"A blog URL is needed.";try{new URL(o)}catch{return"Expected a full URL, protocol included."}return null}function L(e){try{return new URL(e).hostname}catch{return"tumblr-archive"}}async function m(e){let o=e.replace(/^~(?=\/|$)/,g.homedir()),r=h.resolve(o);return await D(r,{recursive:!0}),r}async function q(e,o){if(e!==void 0)return await m(e);let r=h.join(f.cwd(),L(o)),i=await C({message:"Where should the archive be written?",choices:[{name:"Here",value:"here",description:r},{name:"A temporary directory",value:"temp",description:`under ${g.tmpdir()}, cleared on reboot`},{name:"Somewhere else",value:"manual",description:"type a path"}]});if(i==="temp")return;if(i==="here")return await m(r);let c=await w({message:"Which directory?",default:r,validate:u=>u.trim()===""?"A path is needed.":!0});return await m(c.trim())}function x(e){let{url:o,kind:r,postCount:i,newPostCount:c,error:u}=e;if(u!==null){console.log(t.warning(`${"failed".padEnd(10)}${o}`)),console.log(t.light(` ${u}`));return}let P=c===i?a(i,"post"):`${a(i,"post")}, ${c} new`;console.log(`${t.light((r??"unknown").padEnd(10))}${o}`),console.log(t.light(` ${P}`))}var y=new A().name("scrape-tumblr").description("Archives a Tumblr blog: every page it serves, every post it holds.").argument("[blog-url]","any URL on the blog \u2014 only its origin is used").option("-d, --data-dir <path>","where to write, and where to resume from").option("-l, --limit <count>","stop after this many pages",p).option("--delay <ms>","wait between two requests",p,k).option("-r, --resume","pick up where a previous crawl of the same directory stopped",!1).option("--no-sitemap","walk the listings instead of reading the sitemap").option("-q, --quiet","report only the result",!1).parse(),s=y.opts(),[N]=y.args,v=N??await w({message:"Which blog should be scraped? (e.g. https://myblog.tumblr.com)",validate:e=>b(e)??!0}),d=b(v);d!==null&&(console.log(t.error(d)),f.exit(1));var l=v.trim(),S=await q(s.dataDir,l);console.log("");console.log(t.title(`Scraping ${l}...`));console.log(t.light("> starting a headless browser, the blog host refuses plain requests"));console.log("");var n=await E(l,{dataDirPath:S,limit:s.limit,delayMs:s.delay,resume:s.resume,useSitemap:s.sitemap,onPageCrawled:s.quiet?void 0:x}),$=await R(n.dataDirPath),B=$.filter(e=>e.publishedOn!==null).length,I=$.filter(e=>e.rawHtml!==null).length;console.log("");console.log(t.title("Scrape complete."));console.log(t.important(n.blog?.title??l));console.log(t.success(`${a(n.pageCount,"page")} read, ${a(n.postCount,"post")} found`));console.log(t.light(`${B} with a date, ${I} with their markup kept`));n.failures.length>0&&console.log(t.warning(`${a(n.failures.length,"page")} could not be read`));console.log(t.info(`
3
+ Archive`));console.log(t.light(n.dataDirPath));console.log(t.info(`
4
+ Resume`));console.log(t.light(`> scrape-tumblr ${l} --data-dir ${n.dataDirPath} --resume`));console.log("");
5
5
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/scrape-tumblr/index.ts"],
4
- "sourcesContent": ["import process from 'node:process'\nimport { Command, InvalidArgumentError } from 'commander'\nimport { input } from '@inquirer/prompts'\nimport { styles } from '@design-edito/tools/agnostic/misc/logs/styles/index.js'\nimport { crawlBlog, readArchivePosts } from '@mxfb/tools/node/scrapers/@tumblr/index.js'\nimport type { CrawledPageReport } from '@mxfb/tools/node/scrapers/@tumblr/types.js'\n\nconst DEFAULT_DELAY_MS = 500\n\ntype CommandOptions = {\n dataDir?: string\n limit?: number\n delay: number\n resume: boolean\n sitemap: boolean\n quiet: boolean\n}\n\nfunction toPositiveInteger (raw: string): number {\n const parsed = Number.parseInt(raw, 10)\n if (Number.isNaN(parsed) || parsed <= 0) throw new InvalidArgumentError('Expected a positive number.')\n return parsed\n}\n\nfunction pluralize (count: number, singular: string): string {\n return `${count} ${singular}${count === 1 ? '' : 's'}`\n}\n\nfunction reportPage (report: CrawledPageReport): void {\n const { url, kind, postCount, newPostCount, error } = report\n if (error !== null) {\n console.log(styles.warning(`${'failed'.padEnd(10)}${url}`))\n console.log(styles.light(` ${error}`))\n return\n }\n const posts = newPostCount === postCount\n ? pluralize(postCount, 'post')\n : `${pluralize(postCount, 'post')}, ${newPostCount} new`\n console.log(`${styles.light((kind ?? 'unknown').padEnd(10))}${url}`)\n console.log(styles.light(` ${posts}`))\n}\n\nconst program = new Command()\n .name('scrape-tumblr')\n .description('Archives a Tumblr blog: every page it serves, every post it holds.')\n .argument('[blog-url]', 'any URL on the blog \u2014 only its origin is used')\n .option('-d, --data-dir <path>', 'where to write, and where to resume from')\n .option('-l, --limit <count>', 'stop after this many pages', toPositiveInteger)\n .option('--delay <ms>', 'wait between two requests', toPositiveInteger, DEFAULT_DELAY_MS)\n .option('-r, --resume', 'pick up where a previous crawl of the same directory stopped', false)\n .option('--no-sitemap', 'walk the listings instead of reading the sitemap')\n .option('-q, --quiet', 'report only the result', false)\n .parse()\n\nconst options = program.opts<CommandOptions>()\nconst [blogUrlArgument] = program.args\n\nconst blogUrl = blogUrlArgument ?? await input({\n message: 'Which blog should be scraped?',\n default: 'https://example.tumblr.com'\n})\n\nif (blogUrl.trim() === '') {\n console.log(styles.error('No blog to scrape.'))\n process.exit(1)\n}\n\nconsole.log('')\nconsole.log(styles.title(`Scraping ${blogUrl}...`))\n// Chrome has to clear the blog host's challenge before anything is readable, which takes a\n// few seconds on the first page and nothing on the ones after.\nconsole.log(styles.light('> starting a headless browser, the blog host refuses plain requests'))\nconsole.log('')\n\nconst result = await crawlBlog(blogUrl, {\n dataDirPath: options.dataDir,\n limit: options.limit,\n delayMs: options.delay,\n resume: options.resume,\n useSitemap: options.sitemap,\n onPageCrawled: options.quiet ? undefined : reportPage\n})\n\nconst posts = await readArchivePosts(result.dataDirPath)\nconst dated = posts.filter(post => post.publishedOn !== null).length\nconst withBody = posts.filter(post => post.rawHtml !== null).length\n\nconsole.log('')\nconsole.log(styles.title('Scrape complete.'))\nconsole.log(styles.important(result.blog?.title ?? blogUrl))\nconsole.log(styles.success(`${pluralize(result.pageCount, 'page')} read, ${pluralize(result.postCount, 'post')} found`))\nconsole.log(styles.light(`${dated} with a date, ${withBody} with their markup kept`))\nif (result.failures.length > 0) {\n console.log(styles.warning(`${pluralize(result.failures.length, 'page')} could not be read`))\n}\nconsole.log(styles.info('\\nArchive'))\nconsole.log(styles.light(result.dataDirPath))\nconsole.log(styles.info('\\nResume'))\nconsole.log(styles.light(`> scrape-tumblr ${blogUrl} --data-dir ${result.dataDirPath} --resume`))\nconsole.log('')\n"],
5
- "mappings": "AAAA,OAAOA,MAAa,eACpB,OAAS,WAAAC,EAAS,wBAAAC,MAA4B,YAC9C,OAAS,SAAAC,MAAa,oBACtB,OAAS,UAAAC,MAAc,yDACvB,OAAS,aAAAC,EAAW,oBAAAC,MAAwB,6CAG5C,IAAMC,EAAmB,IAWzB,SAASC,EAAmBC,EAAqB,CAC/C,IAAMC,EAAS,OAAO,SAASD,EAAK,EAAE,EACtC,G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AAU,CAAC,EACnC,QAAQ,IAAIA,EAAO,MAAM,mBAAmBqB,CAAO,eAAeC,EAAO,WAAW,WAAW,CAAC,EAChG,QAAQ,IAAI,EAAE",
6
- "names": ["process", "Command", "InvalidArgumentError", "input", "styles", "crawlBlog", "readArchivePosts", "DEFAULT_DELAY_MS", "toPositiveInteger", "raw", "parsed", "pluralize", "count", "singular", "reportPage", "report", "url", "kind", "postCount", "newPostCount", "error", "posts", "program", "options", "blogUrlArgument", "blogUrl", "result", "dated", "post", "withBody"]
4
+ "sourcesContent": ["import { mkdir } from 'node:fs/promises'\nimport os from 'node:os'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { Command, InvalidArgumentError } from 'commander'\nimport { input, select } from '@inquirer/prompts'\nimport { styles } from '@design-edito/tools/agnostic/misc/logs/styles/index.js'\nimport { crawlBlog, readArchivePosts } from '@mxfb/tools/node/scrapers/@tumblr/index.js'\nimport type { CrawledPageReport } from '@mxfb/tools/node/scrapers/@tumblr/types.js'\n\nconst DEFAULT_DELAY_MS = 500\n\ntype CommandOptions = {\n dataDir?: string\n limit?: number\n delay: number\n resume: boolean\n sitemap: boolean\n quiet: boolean\n}\n\nfunction toPositiveInteger (raw: string): number {\n const parsed = Number.parseInt(raw, 10)\n if (Number.isNaN(parsed) || parsed <= 0) throw new InvalidArgumentError('Expected a positive number.')\n return parsed\n}\n\nfunction pluralize (count: number, singular: string): string {\n return `${count} ${singular}${count === 1 ? '' : 's'}`\n}\n\nfunction toBlogUrlError (raw: string): string | null {\n const trimmed = raw.trim()\n if (trimmed === '') return 'A blog URL is needed.'\n try { new URL(trimmed) }\n catch { return 'Expected a full URL, protocol included.' }\n return null\n}\n\nfunction toArchiveDirName (rawUrl: string): string {\n try { return new URL(rawUrl).hostname }\n catch { return 'tumblr-archive' }\n}\n\n// inquirer hands back what was typed, so a leading ~ never went through a shell.\nasync function ensureDirectory (rawPath: string): Promise<string> {\n const expanded = rawPath.replace(/^~(?=\\/|$)/, os.homedir())\n const dirPath = path.resolve(expanded)\n await mkdir(dirPath, { recursive: true })\n return dirPath\n}\n\nasync function resolveDataDirPath (\n optionPath: string | undefined,\n blogUrl: string\n): Promise<string | undefined> {\n if (optionPath !== undefined) return await ensureDirectory(optionPath)\n const herePath = path.join(process.cwd(), toArchiveDirName(blogUrl))\n const choice = await select({\n message: 'Where should the archive be written?',\n choices: [\n { name: 'Here', value: 'here', description: herePath },\n { name: 'A temporary directory', value: 'temp', description: `under ${os.tmpdir()}, cleared on reboot` },\n { name: 'Somewhere else', value: 'manual', description: 'type a path' }\n ]\n })\n if (choice === 'temp') return undefined\n if (choice === 'here') return await ensureDirectory(herePath)\n const typedPath = await input({\n message: 'Which directory?',\n default: herePath,\n validate: value => value.trim() === '' ? 'A path is needed.' : true\n })\n return await ensureDirectory(typedPath.trim())\n}\n\nfunction reportPage (report: CrawledPageReport): void {\n const { url, kind, postCount, newPostCount, error } = report\n if (error !== null) {\n console.log(styles.warning(`${'failed'.padEnd(10)}${url}`))\n console.log(styles.light(` ${error}`))\n return\n }\n const posts = newPostCount === postCount\n ? pluralize(postCount, 'post')\n : `${pluralize(postCount, 'post')}, ${newPostCount} new`\n console.log(`${styles.light((kind ?? 'unknown').padEnd(10))}${url}`)\n console.log(styles.light(` ${posts}`))\n}\n\nconst program = new Command()\n .name('scrape-tumblr')\n .description('Archives a Tumblr blog: every page it serves, every post it holds.')\n .argument('[blog-url]', 'any URL on the blog \u2014 only its origin is used')\n .option('-d, --data-dir <path>', 'where to write, and where to resume from')\n .option('-l, --limit <count>', 'stop after this many pages', toPositiveInteger)\n .option('--delay <ms>', 'wait between two requests', toPositiveInteger, DEFAULT_DELAY_MS)\n .option('-r, --resume', 'pick up where a previous crawl of the same directory stopped', false)\n .option('--no-sitemap', 'walk the listings instead of reading the sitemap')\n .option('-q, --quiet', 'report only the result', false)\n .parse()\n\nconst options = program.opts<CommandOptions>()\nconst [blogUrlArgument] = program.args\n\nconst rawBlogUrl = blogUrlArgument ?? await input({\n message: 'Which blog should be scraped? (e.g. https://myblog.tumblr.com)',\n validate: value => toBlogUrlError(value) ?? true\n})\n\nconst blogUrlError = toBlogUrlError(rawBlogUrl)\nif (blogUrlError !== null) {\n console.log(styles.error(blogUrlError))\n process.exit(1)\n}\n\nconst blogUrl = rawBlogUrl.trim()\n\nconst dataDirPath = await resolveDataDirPath(options.dataDir, blogUrl)\n\nconsole.log('')\nconsole.log(styles.title(`Scraping ${blogUrl}...`))\n// Chrome has to clear the blog host's challenge before anything is readable, which takes a\n// few seconds on the first page and nothing on the ones after.\nconsole.log(styles.light('> starting a headless browser, the blog host refuses plain requests'))\nconsole.log('')\n\nconst result = await crawlBlog(blogUrl, {\n dataDirPath,\n limit: options.limit,\n delayMs: options.delay,\n resume: options.resume,\n useSitemap: options.sitemap,\n onPageCrawled: options.quiet ? undefined : reportPage\n})\n\nconst posts = await readArchivePosts(result.dataDirPath)\nconst dated = posts.filter(post => post.publishedOn !== null).length\nconst withBody = posts.filter(post => post.rawHtml !== null).length\n\nconsole.log('')\nconsole.log(styles.title('Scrape complete.'))\nconsole.log(styles.important(result.blog?.title ?? blogUrl))\nconsole.log(styles.success(`${pluralize(result.pageCount, 'page')} read, ${pluralize(result.postCount, 'post')} found`))\nconsole.log(styles.light(`${dated} with a date, ${withBody} with their markup kept`))\nif (result.failures.length > 0) {\n console.log(styles.warning(`${pluralize(result.failures.length, 'page')} could not be read`))\n}\nconsole.log(styles.info('\\nArchive'))\nconsole.log(styles.light(result.dataDirPath))\nconsole.log(styles.info('\\nResume'))\nconsole.log(styles.light(`> scrape-tumblr ${blogUrl} --data-dir ${result.dataDirPath} --resume`))\nconsole.log('')\n"],
5
+ "mappings": "AAAA,OAAS,SAAAA,MAAa,mBACtB,OAAOC,MAAQ,UACf,OAAOC,MAAU,YACjB,OAAOC,MAAa,eACpB,OAAS,WAAAC,EAAS,wBAAAC,MAA4B,YAC9C,OAAS,SAAAC,EAAO,UAAAC,MAAc,oBAC9B,OAAS,UAAAC,MAAc,yDAC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QAAQ,GAAGO,EAAUgC,EAAO,SAAS,OAAQ,MAAM,CAAC,oBAAoB,CAAC,EAE9F,QAAQ,IAAIvC,EAAO,KAAK;AAAA,QAAW,CAAC,EACpC,QAAQ,IAAIA,EAAO,MAAMuC,EAAO,WAAW,CAAC,EAC5C,QAAQ,IAAIvC,EAAO,KAAK;AAAA,OAAU,CAAC,EACnC,QAAQ,IAAIA,EAAO,MAAM,mBAAmBoB,CAAO,eAAemB,EAAO,WAAW,WAAW,CAAC,EAChG,QAAQ,IAAI,EAAE",
6
+ "names": ["mkdir", "os", "path", "process", "Command", "InvalidArgumentError", "input", "select", "styles", "crawlBlog", "readArchivePosts", "DEFAULT_DELAY_MS", "toPositiveInteger", "raw", "parsed", "pluralize", "count", "singular", "toBlogUrlError", "trimmed", "toArchiveDirName", "rawUrl", "ensureDirectory", "rawPath", "expanded", "dirPath", "resolveDataDirPath", "optionPath", "blogUrl", "herePath", "choice", "typedPath", "value", "reportPage", "report", "url", "kind", "postCount", "newPostCount", "error", "posts", "program", "options", "blogUrlArgument", "rawBlogUrl", "blogUrlError", "dataDirPath", "result", "dated", "post", "withBody"]
7
7
  }