-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* load cmd * commit cmd * detect that git repo was already created
- Loading branch information
Showing
4 changed files
with
83 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Commit history JSON to git. | ||
*/ | ||
import { LoadData } from './LoadData.js'; | ||
|
||
// | ||
// Config. | ||
// change this values to your needs | ||
const repoName = 'wiki-exampleGadgetScript'; | ||
const filename = 'exampleGadgetScript.js'; | ||
// optional JSON file name (default: 'history.json') | ||
const historyFile = ''; | ||
|
||
const loader = new LoadData(); | ||
|
||
/** | ||
* Read page history from JSON. | ||
*/ | ||
loader.history = []; | ||
await loader.readHistory(historyFile); | ||
loader.info(); | ||
|
||
/** | ||
* Create Git repo. | ||
*/ | ||
console.log('\n\nCreating Git repo (%s).', repoName); | ||
loader.repoCreate(repoName); | ||
console.log('\nSave history as %s.', filename); | ||
loader.repoCommit(repoName, filename); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Download page history from a MediaWiki site. | ||
*/ | ||
import { LoadData } from './LoadData.js'; | ||
|
||
// | ||
// Config. | ||
// change this values to your needs | ||
const site = 'en.wikipedia.org'; | ||
const page = 'MediaWiki:Gadget-exampleGadgetScript.js'; | ||
// optional JSON file name (default: 'history.json') | ||
const historyFile = ''; | ||
|
||
const loader = new LoadData(site); | ||
|
||
/** | ||
* Download page history from a MediaWiki site. | ||
*/ | ||
console.log('\n\nDownload history for %s.', page); | ||
// this will load version history into internals | ||
await loader.load(page); | ||
// this will save history as JSON | ||
await loader.saveHistory(historyFile); | ||
// this just shows a quick info (you can skip this) | ||
loader.info(); |