Try decompress CORPUS
This commit is contained in:
parent
b776e39d45
commit
1bdd18eb21
@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
const keys = require('/srv/keys/owlboard/keys.configs');
|
const keys = require('/srv/keys/owlboard/keys.configs');
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
|
const zlib = require('zlib');
|
||||||
|
|
||||||
/*async*/ function getCorpus(){
|
async function getCorpus(){
|
||||||
authHead = Buffer.from(`${keys.nr_user}:${keys.nr_pass}`).toString('base64');
|
authHead = Buffer.from(`${keys.nr_user}:${keys.nr_pass}`).toString('base64');
|
||||||
getOpts = {
|
getOpts = {
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -14,12 +15,14 @@ const axios = require('axios');
|
|||||||
headers: {'Authorization': `Basic ${authHead}`}
|
headers: {'Authorization': `Basic ${authHead}`}
|
||||||
}
|
}
|
||||||
axios(getOpts).then((response) => {
|
axios(getOpts).then((response) => {
|
||||||
console.log(response);
|
decompress(response);
|
||||||
|
console.log(raw);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function gunzipCorpus(){
|
async function decompress(data){
|
||||||
// Extract the Corpus JSON from the GZIP Response
|
let raw = zlib.gunzip(data);
|
||||||
|
return raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function cleanCorpus(){
|
async function cleanCorpus(){
|
||||||
|
Reference in New Issue
Block a user