Skip to content

Commit

Permalink
listCategory: dodaj skrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Apr 23, 2016
1 parent 8651d70 commit 0bfbb7c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions listCategory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env node
/**
* Skrypt generujący listę artykułów w kategorii
*/
'use strict';

var bot = require('nodemw'),
client = new bot('config.js'),
CATEGORY = process.argv[2];

client.getPagesInCategory(CATEGORY, (err, pages) => {
const wikitext = pages.
// tylko strony w NS_MAIN
filter((page) => page.ns === 0).
// linkuj
map((page) => `[[${page.title}]]`).
// sortuj
sort().
join(" •\n");

console.log(wikitext);
});

0 comments on commit 0bfbb7c

Please sign in to comment.