Try decompress CORPUS

This commit is contained in:
Fred Boniface 2022-12-07 01:28:00 +00:00
parent b776e39d45
commit 1bdd18eb21

View File

@ -4,8 +4,9 @@
const keys = require('/srv/keys/owlboard/keys.configs');
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');
getOpts = {
method: 'get',
@ -14,12 +15,14 @@ const axios = require('axios');
headers: {'Authorization': `Basic ${authHead}`}
}
axios(getOpts).then((response) => {
console.log(response);
decompress(response);
console.log(raw);
})
}
async function gunzipCorpus(){
// Extract the Corpus JSON from the GZIP Response
async function decompress(data){
let raw = zlib.gunzip(data);
return raw;
}
async function cleanCorpus(){