Skip to content

Commit

Permalink
refactor load example
Browse files Browse the repository at this point in the history
  • Loading branch information
Eccenux committed Aug 5, 2023
1 parent 4efc19c commit 60f75e6
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
/**/

0 comments on commit 60f75e6

Please sign in to comment.