tumblr-ask

Sends asks to tumblogs.

npm install tumblr-ask
4 downloads in the last month

tumblr-ask

Sends asks to tumblogs.

Now with login!

installing

npm install tumblr-ask

without login

var ask = require("tumblr-ask");
ask("a_blog.tumblr.com", "message", function(result) {
  if(result === true) console.log("Success!");
  else console.log(result);
})

with login

var ask = require("tumblr-ask");
ask("a_blog.tumblr.com", {message:  "message", email: "user@johnsmithwasnthere.com", password: "neverwashere"}, function(result) {
  if(result === true) console.log("Success!");
  else console.log(result);
});

semi-permanent login

var ask = require("tumblr-ask");
ask.login("user@johnsmithwasnthere.com", "neverwashere", function(success) {
  ask("a_blog.tumblr.com", message:  "message", function(result) {
    if(result === true) console.log("Success!");
    else console.log(result);
  });
});

permanent login

var ask = require("tumblr-ask"), fs = require("fs");
var do_the_ask = function() {
  ask("a_blog.tumblr.com", message:  "message", function(result) {
    if(result === true) console.log("Success!");
    else console.log(result);
  });
}

if(!fs.existsSync("./cookie.jar")) {
  ask.login("user@johnsmithwasnthere.com", "neverwashere", function(success) {
    fs.writeFile("./cookie.jar", JSON.stringify(ask.getjar()));
    do_the_ask();
  });
} else {
  ask.jar(JSON.parse(fs.readFileSync("./cookie.jar")));
  do_the_ask();
}
npm loves you