modules

ac-bundle-module-api-scraper

api/scraper.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: requestCallback

requestCallback

async function(callback, errorCallback, path) {
  var link = config.scraper.link + "/" + path.split("?").join("?authorization=" + config.scraper.authorization + "&");
  if (config.api.log.url) console.log("SCRAPER:", link);
  var result = await fetch(link);
  if (result.status === 200) {
    if (typeof callback === "function") await callback(await result.json());
  } else {
    if (typeof errorCallback === "function") await errorCallback("Could not fetch from scraper.", await result.text());
  }
}

Happy Coding!

Leave a Reply

Your email address will not be published. Required fields are marked *