artoo
artoo copied to clipboard
artoo.saveImage seems to always error out with: "Uncaught TypeError: i.getExtension is not a function"
I've tried to trace back through minified spaghetti, looks like 'i' is Emmett instance, and it doesn't have this function?
artoo.saveImage('img',{filename:'test.jpg'});
Uncaught TypeError: i.getExtension is not a function at o.artoo.saveImage (artoo-latest.min.js:2) at :1:7
That's a strange issue. Did you load the bookmarklet from the documentation's site? Emmet should be bundled with it.
Thanks for quick response, using latest bookmarklet (yesterday) Pretty frustrating, savePageHtml works fine but no dice on saveImage, I could just be doing something wrong, but are you sure project isn't just in a broken state?
tracing it back from github source: src/methods/artoo.methods.save.js var ext = helpers.getExtension($sel.attr('src')),
var _root = this, helpers = artoo.helpers;
but artoo.helpers as defined in artoo/src/artoo.helpers.js has no getExtension method?
repro: running on page: http://imgur.com/gallery/j2sqN
artoo.scrape('img[src*=OccRL0yr]','src');
["//i.imgur.com/OccRL0yr.jpg"]
artoo.saveImage('img[src*=OccRL0yr]',{filename:'test.jpg'});
artoo-latest.min.js:2 Uncaught TypeError: i.getExtension is not a function
at o.artoo.saveImage (artoo-latest.min.js:2)
at <anonymous>:1:7
artoo.saveImage @ artoo-latest.min.js:2
(anonymous) @ VM1358:1
artoo.saveImage('img',{filename:'test.jpg'});
artoo-latest.min.js:2 Uncaught TypeError: i.getExtension is not a function
at o.artoo.saveImage (artoo-latest.min.js:2)
at <anonymous>:1:7
Well that's quite strange, I don't know why but this helper has indeed disappeared. I need to add it back. Can you ping me if I forget please?
thanks, please LMK!
Just released a v0.3.4 that should solve your issue. Be sure to empty your browser's cache and that the bookmarklet loads the correct version when loading artoo.
thanks! I've implemented a more robust spider that can handle XHR request http errors, would you be interested in incorporating, should I sub a pull req?
Can you show me your code or its documentation somehow?