Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Oct 14, 2024
1 parent a73f488 commit 108e916
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions lib/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 108e916

Please sign in to comment.