models.register({ name : 'Google Notebook', ICON : 'http://www.google.com/notebook/images/3406433090-favicon.ico', check : function(ps){ return ps.type=='regular'; }, post : function(ps){ return request('http://www.google.com/notebook/m', { queryString : { hl : 'jp', }, }).addCallback(function(res){ var doc = convertToHTMLDocument(res.responseText); if(doc.getElementById('gaia_loginform')) throw new Error(getMessage('error.notLoggedin')); var fs = formContents(doc); return request('http://www.google.com/notebook/m/addnote', { redirectionLimit : 0, sendContent: { security_token : fs.security_token, nbid: fs.nbid, hl: fs.hl, contents: ps.description, }, }); }); }, });