elara-google-search
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -11,3 +11,8 @@ module.exports = class Google{ | ||
if(res.status === 200){ | ||
return {status: true, res: res.body}; | ||
let links = []; | ||
if(res.body.items.length === 0) return {status: false, message: `Nothing for that. :(`}; | ||
for await (const i of res.body.items){ | ||
links.push(i.link); | ||
}; | ||
return {status: true, res: res.body, links: links}; | ||
}else{ | ||
@@ -14,0 +19,0 @@ return {status: false, message: `I was unable to find a search for that.`}; |
{ | ||
"name": "elara-google-search", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Returns the google search results, requires an api key & cx ID", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,3 +11,3 @@ #Example Usage | ||
// Success | ||
console.log(res); | ||
console.log(res); // "res.links" to return all of the links found for that search! | ||
}else{ | ||
@@ -14,0 +14,0 @@ // Failed |
1558
20