Skip to content

Instantly share code, notes, and snippets.

@MrYakobo
Created January 29, 2018 20:40
Show Gist options
  • Save MrYakobo/e46406db294f4821d94e2263c49b579d to your computer and use it in GitHub Desktop.
Save MrYakobo/e46406db294f4821d94e2263c49b579d to your computer and use it in GitHub Desktop.
var a = $("a>img").map((i,t)=>$(t).attr('data-src'));
var arr = [];
for(var i = 0; i < a.length; i++)
arr.push(a[i]);
var c = arr.map(t=>{
var b = `-o ${/[^\/]+?\.png|[^\/]+?\.jpg/.exec(t)}`
if(b != null){
return `${b.replace('/','')} "${t.replace(/scale-to-width-down.+$/,'')}"`
}
return ''
}).filter(t=>t!='').join(' ');
copy("curl " + c); //execute with curl in terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment