google-search-parser2
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "google-search-parser2", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Parse image and Knowledge Graph data from Google Search results", | ||
@@ -17,3 +17,3 @@ "main": "parser.js", | ||
"scripts": { | ||
"test": "jasmine-node spec", | ||
"test": "jasmine-node spec --captureExceptions", | ||
"lint": "eslint ." | ||
@@ -20,0 +20,0 @@ }, |
@@ -86,3 +86,6 @@ var htmlparser = require("htmlparser2"); | ||
var metaObject = JSON.parse(text); | ||
results.push(metaObject.ou); | ||
results.push({ | ||
url: metaObject.ou, | ||
caption: metaObject.pt | ||
}); | ||
count++; | ||
@@ -89,0 +92,0 @@ } |
@@ -41,4 +41,4 @@ # google-search-parser2 | ||
parser.parseImageUrls(searchTerm, function (urls) { | ||
console.log(urls); // [ "https://upload.wikimedia.org/wikipedia/en/f/f4/Supermarioworld.jpg", "http ... | ||
console.log(urls); // [ { url: "https://upload.wikimedia.org/wikipedia/en/f/f4/Supermarioworld.jpg", caption: "foo" }, { url: "http ... | ||
}); | ||
``` |
@@ -83,3 +83,2 @@ /*global describe, it, expect, jasmine */ | ||
expect(results.genre).toEqual("Platform game"); | ||
expect(results.series).toEqual("Mario Series"); | ||
expect(results.developers).toContain("Nintendo"); | ||
@@ -100,3 +99,3 @@ expect(results.designers).toContain("Shigeru Miyamoto"); | ||
// act | ||
parser.parseImageUrls("Super Mario 64", function (result) { | ||
parser.parseImageUrls("gloom amiga screenshot", function (result) { | ||
@@ -120,4 +119,5 @@ // assert | ||
expect(singleResult).toEqual(jasmine.any(String)); | ||
expect(singleResult).toContain("http"); | ||
expect(singleResult.url).toEqual(jasmine.any(String)); | ||
expect(singleResult.url).toContain("http"); | ||
expect(singleResult.caption).toEqual(jasmine.any(String)); | ||
} | ||
@@ -124,0 +124,0 @@ done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10762
299