diff --git a/lib/summary.js b/lib/summary.js index 5d94438..6679a55 100644 --- a/lib/summary.js +++ b/lib/summary.js @@ -14,21 +14,22 @@ import { export const summarizeFromUrl = function (url, callback) { if (isValidUrl(url)) { - axios.get(url).then((response) => { - const body = response.data + axios + .get(url) + .then(response => { + const body = response.data - let title = getTitle(body) - let text = convertHTMLToText(body) - let content = onlyGetSentences(text) + let title = getTitle(body) + let text = convertHTMLToText(body) + let content = onlyGetSentences(text) - return summarize(title, content, (err, result, dict) => callback(err, result, dict)) - }) - .catch((error) => { - callback( - true, - 'Failed to fetch the url. Please try again later.' - ) - }) + return summarize(title, content, (err, result, dict) => + callback(err, result, dict) + ) + }) + .catch(error => { + callback(true, 'Failed to fetch the url. Please try again later.') + }) } else { callback( true,