Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated foursquare and pivotal tracker handlers. Added posterous hand…
…ler.
- Loading branch information
1 parent
4a415b6
commit 1733122
Showing
3 changed files
with
33 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Authors: | ||
// Eric Butler <eric@codebutler.com> | ||
|
||
register({ | ||
name: 'Posterous', | ||
|
||
matchPacket: function (packet) { | ||
if (packet.cookies['_sharebymail_session_id'] && packet.cookies['posterous_mp']) { | ||
var data = JSON.parse(unescape(packet.cookies['posterous_mp'])); | ||
return data.all && data.all.registered == "true"; | ||
} | ||
return false; | ||
}, | ||
|
||
processPacket: function () { | ||
this.sessionId = this.firstPacket.cookies['_sharebymail_session_id']; | ||
}, | ||
|
||
identifyUser: function () { | ||
var resp = this.httpGet('http://posterous.com/manage/settings/contact'); | ||
var firstName = resp.body.querySelector('#user_firstname').value; | ||
var lastName = resp.body.querySelector('#user_lastname').value; | ||
|
||
this.userName = firstName + ' ' + lastName; | ||
this.userAvatar = resp.body.querySelector('img[alt="user photo"]').src; | ||
} | ||
}); |