From 60f75e66c6485be9fd08a1406cac791381f2479b Mon Sep 17 00:00:00 2001 From: eccenux Date: Sat, 5 Aug 2023 04:36:36 +0200 Subject: [PATCH] refactor load example --- src/load.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/load.js b/src/load.js index 909c6ca..98ab1ee 100644 --- a/src/load.js +++ b/src/load.js @@ -2,16 +2,22 @@ import GitOps from './GitOps.js'; import { LoadData } from './LoadData.js'; -/** - * Download page history from a Mediawiki site. - */ +// settings const site = 'pl.wikipedia.org'; const page = 'MediaWiki:Gadget-gConfig.js'; +const repoName = 'wiki-gConfig-test'; +const filename = 'gConfig.js'; + +// init const loader = new LoadData(site); + +/** + * Download page history from a Mediawiki site. + */ console.log('\n\nDownload history for %s.', page); -// await loader.load(page); -// await loader.saveHistory(); -// loader.info(); +await loader.load(page); +await loader.saveHistory(); +loader.info(); /** * Read page history from JSON. @@ -25,10 +31,10 @@ loader.info(); /** * Create Git repo. - */ -const repoName = 'wiki-gConfig-test'; -const filename = 'gConfig.js'; + * console.log('\n\nCreating Git repo (%s).', repoName); loader.repoCreate(repoName); +/** console.log('\nSave history as %s.', filename); loader.repoCommit(repoName, filename); +/**/