-
Notifications
You must be signed in to change notification settings - Fork 30
Client (OO Wrapper)
Lucas Dohring edited this page Dec 6, 2013
·
3 revisions
This is an OO wrapper for the procedural api.
Create a new client instance.
username-
passwordSign in to Snapchat. On success, it will return sync data.
usernameemail-
passwordRegister an account. On success, it will return sync data.
Delete the auth_token property. (No way to really sign out)
Get new sync data
You must have either signed in or signed up.
Clear your feed
Fetches a blob (image or video)
-
idThe blob's id. This is a number followed by 'r'
Returns a promise of a readable stream. IMPORTANT The stream is paused to prevent data loss. You MUST call resume() on it after setting up your handlers or pipe()ing it.
Upload an blob
-
blobA Readable stream of an image or video to upload. (The official app can view jpeg and pngs images; and mp4 video. It can not view gifs. [possibly more]) -
isVideoSet this totrueif you are uploading a video.
Returns a promise of it's media_id
Send the snap to people
-
mediaIdThe blobs's media_id -
friendsA list of people to send the snap to. -
timeHow long (in seconds) a snap should be visible. This should only be set if the snap is a picture.
Add a friend
-
friendThe username of your soon-to-be friend
Set a friend's display name.
-
friendThe friend to rename. -
newNameTheir new display name.
Remove a friend.
-
friendThe friend to remove
Update your privacy setting
-
onlyFriendsIftrue, only friends can send you snaps.
Change your email
-
emailYour new email