Created
June 20, 2010 16:30
-
-
Save Constellation/445934 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
models.register({ | |
name : 'ReadItLater', | |
ICON : 'http://readitlaterlist.com/favicon.ico', | |
LINK : 'http://readitlaterlist.com/', | |
LOGIN_URL : 'http://readitlaterlist.com/l', | |
check : function(ps){ | |
return /quote|link/.test(ps.type); | |
}, | |
post : function(ps){ | |
var that = this; | |
return request('http://readitlaterlist.com/edit').addCallback(function(res) { | |
var doc = convertToHTMLDocument(res.responseText); | |
var form = $x('id("content")/form', doc); | |
if (form) { | |
return request('http://readitlaterlist.com/edit_process.php', { | |
queryString: { | |
BL: 1 | |
}, | |
sendContent: update(formContents(form), { | |
tags : ps.tags? ps.tags.join(',') : '', | |
title: ps.item, | |
url : ps.itemUrl | |
}) | |
}); | |
} else { | |
throw new Error(getMessage('error.notLoggedin')); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment