diff --git a/src/scraper.ts b/src/scraper.ts index e32fa5c..bdb7fef 100644 --- a/src/scraper.ts +++ b/src/scraper.ts @@ -78,7 +78,6 @@ function getDefinitions(term: string) { // TODO: Finish ratings // const upvotes = $(this).find(".thumbs[data-direction=up]").find("span"); - // @ts-ignore const definition = { meaning: meaning, example: example, @@ -92,8 +91,6 @@ function getDefinitions(term: string) { }, }; - //console.log(definition); - defintions.push(definition); }); } @@ -102,26 +99,4 @@ function getDefinitions(term: string) { }); } -getDefinitions("yogurt"); - -export default function scrapeData(url: string) { - return new Promise(async function (resolve, reject) { - const [success, data] = await handlePromise(axios.get(url)); - - if (success) { - const html = data.data; - - const $ = cheerio.load(html); - - // For now, only scraping the first/top meaning; - - const meaning = $(".meaning.mb-4").first().text().trim(); - - resolve(meaning); - } else { - console.error(data); - - reject(data); - } - }); -} +export { getDefinitions };