image-resolver
Advanced tools
Comparing version 0.5.3 to 0.5.4
{ | ||
"name": "image-resolver", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Extract main image for a given URL", | ||
@@ -5,0 +5,0 @@ "main": "src/ImageResolver.js", |
@@ -5,3 +5,3 @@ /** | ||
var API_URL = 'http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key={{APIKEY}}&photo_id={{ID}}&format=json&nojsoncallback=1'; | ||
var API_URL = 'https://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key={{APIKEY}}&photo_id={{ID}}&format=json&nojsoncallback=1'; | ||
@@ -45,2 +45,2 @@ function Flickr(apikey) { | ||
module.exports = Flickr; | ||
module.exports = Flickr; |
@@ -96,2 +96,6 @@ /** | ||
if ( !img[i].attribs['src'] ) { | ||
continue; | ||
} | ||
//Compute surface | ||
@@ -143,2 +147,2 @@ var w = img[i].attribs['width'] || 1; | ||
module.exports = Webpage; | ||
module.exports = Webpage; |
@@ -18,3 +18,3 @@ var ImageResolver = require('../../../src/ImageResolver'); | ||
runs(function(){ | ||
expect(result.image).toBe("http://farm9.staticflickr.com/8431/7543031692_494bed13d4_b.jpg"); | ||
expect(result.image).toBe("https://farm9.staticflickr.com/8431/7543031692_494bed13d4_b.jpg"); | ||
}); | ||
@@ -37,5 +37,5 @@ }); | ||
runs(function(){ | ||
expect(result.image).toBe("http://farm3.staticflickr.com/2906/14248906772_8cc69441ee_b.jpg"); | ||
expect(result.image).toBe("https://farm3.staticflickr.com/2906/14248906772_8cc69441ee_b.jpg"); | ||
}); | ||
}); | ||
}); |
@@ -22,1 +22,19 @@ var ImageResolver = require('../../../src/ImageResolver'); | ||
}); | ||
describe("Webpage : no image", function(){ | ||
it("should return the image URL", function(){ | ||
var result; | ||
imageresolver.resolve( | ||
"http://perdu.com/", | ||
function(res){ | ||
result = ( res === null ) ? true : false; | ||
} | ||
); | ||
waitsFor(function(){ | ||
return result; | ||
}, 10000); | ||
runs(function(){ | ||
expect(result).toBe(true); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
794779
35
22042
10
10