Skip to content

Instantly share code, notes, and snippets.

@ino46
Created March 24, 2009 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ino46/84146 to your computer and use it in GitHub Desktop.
Save ino46/84146 to your computer and use it in GitHub Desktop.
models.register({
name : 'Google Calendar',
ICON : 'http://calendar.google.com/googlecalendar/images/favicon.ico',
check : function(ps){
return ps.type=='regular';
},
post : function(ps){
return request('http://www.google.com/calendar/m', {
queryString : {
hl : 'en',
},
}).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/calendar/m', {
redirectionLimit : 0,
sendContent: {
ctext : ps.description,
secid : fs.secid,
as_sdt : fs.as_sdt,
},
});
});
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment