/
example.js
45 lines (41 loc) · 1.19 KB
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const scavenge = require('./index.js')
// Loads an external JSON file with scavenging instructions
function scavengeJsonFile (name) {
var instructions
try {
instructions = require(name)
} catch (e) {
console.log('Cannot require', name)
}
if (instructions) {
scavenge(instructions)
} else {
console.warn('Could not load JSON configuration', name)
}
}
// Testing entry point
scavengeJsonFile('./examples/PerformancePhilosophy.json')
// var download = require('./plugins/download')
// download.onData(
// { pdf: 'http://ro.uow.edu.au/cgi/viewcontent.cgi?article=1004&context=ozsydney' },
// { url: "${pdf}",
// filepath: "OZ/issue.pdf"
// }).then(()=> {
// console.log('fdsfdsfsdf');
// })
/*
var download = require('./plugins/download')
download.onData(
{ pdf: 'http://ro.uow.edu.au/cgi/viewcontent.cgi?article=1004&context=ozsydney' },
{ url: "${pdf}",
directory: "OZ/"
`` })
{
year: '2017',
yearUrl: '/hansard/daily-hansard/3389-council-2017',
pdf: '/images/stories/daily-hansard/Council_2017/Council_Daily_Extract_Friday_20_October_2017_from_Book_17.pdf' },
{
url: "https://www.parliament.vic.gov.au/${pdf}",
directory: "${year}"
})
*/