Skip to content

Instantly share code, notes, and snippets.

@zwilias
Created May 30, 2013 10:30
Show Gist options
  • Save zwilias/5677012 to your computer and use it in GitHub Desktop.
Save zwilias/5677012 to your computer and use it in GitHub Desktop.
A wget wrapper for mongo-shell
function wget(url){
var tmp = "/tmp",
id = new ObjectId(),
outFile= tmp + "/wget" + id,
logFile= tmp + "/wgetLog",
p = run("wget", "--output-file=" + logFile, "--output-document=" + outFile, url),
result = "";
if (p==0){
result = cat(outFile);
}
removeFile(outFile);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment