UFacebook is a module enabling URBI to handle Facebook social networking service. It enables the robot to post new stories, upload photos (eg. from his camera), retrieve posts and a perform a variety of other tasks that your FB app might require. With the module you can use our official "FLASH Connect" facebook application or create your own app.
By clicking "Log In" below, the app will receive: your friend list, your email address, your profile info: birthday, groups, likes and location, your events, your photos. This app may post on your behalf, including status updates, photos and more.
- set locale of the API, eg. "en_US"
UFacebook.Login("user", "password", check_permissions)
- log in,
user - facebook login,
password - login password,
check_permission - request the permissions scope for your app (bool value).
Permissions are strings that are passed along with a login request. When you set check_permission to true, the following scope will be requested from the person using your app (eg. FLASH Connect):
"read_stream" - provides access to all the posts in the person's news feed,
"read_mailbox" - provides the ability to read from a user's Facebook Inbox,
"email" - provides access to the user's primary email address,
"manage_notifications" - enables your app to read notifications,
"publish_actions" - enables app to post content, comments and likes to a user's stream,
"user_birthday" - provides access to the birthday with year as the birthday property,
"user_location" - provides access to the user's current city,
"user_likes" - provides access to the list of all of the pages the user has liked,
"user_photos" - provides access to the photos the user has uploaded, and photos the user has been tagged in,
"user_friends" - grants the app permission to read a list of friends who also use your app,
"user_events" - provides access to the list of events the user is attending,
"user_groups" - provides access to the list of groups the user is a member.
You can also manually set multiple permissions. In this case set check_permission to false and use the slot below.
UFacebook.SetPermissions(["permission1","permission2",...,"permission"]) - manually set permission scope,
UFacebook.errorMessage; - error message received from FB service,
UFacebook.errorCode; - error code received from FB service,
UFacebook.errorSubCode; - error subcode received from FB service.
UFacebook.GetUser("user_id") - get user info (see slots below),
UFacebook.userID - The id of user account, this ID is unique to each app and cannot be used across different apps,
UFacebook.userName - user's full name,
UFacebook.userFirstName - user's first name,
UFacebook.userLastName - user's last name,
UFacebook.userGender - gender pronoun selected by the user,
UFacebook.userBirthday - user's birthday in the format MM/DD/YYYY (user_birthday permission required),
UFacebook.userLocation - user's current location as entered by them on their profile (user_location permission required),
UFacebook.userEmail - user's primary email address listed on their profile (email permission required),
UFacebook.GetUserLikes("user_id") - get user's likes,
UFacebook.userLikeID; - like's ID,
UFacebook.userLikeName; - like's Name,
UFacebook.userLikeCategory; - like's category,
(read_stream and publish_action permissions required)
UFacebook.GetPosts("user_id", limit, "mode") - returns posts
limit - number of posts,
"posts" - get posts created by the user (on their own wall or the wall of a friend); these may include any kind of content such as shared links, check-ins, photos and status updates,
"feed" - all the things that a user might see on his own wall, shared links, check-ins, photos and status updates. This also includes posts made by friends on the user's wall,
"home"- all the posts created by the user and their friends, i.e. the content of “News Feed” on Facebook,
UFacebook.PutPost("user_id", "message") - post a message,
UFacebook.postID - post id number,
UFacebook.postFromID - the ID of the user who posted the post,
UFacebook.postFromName - the full name of the userwho posted the post,
UFacebook.postMessage - post message content,
UFacebook.postType - indication of the object type of this post (link, status, photo, video),
UFacebook.postStatusType - description of the type of status update (mobile_status_update, created_note, added_photos, added_video, shared_story, created_group, created_event, wall_post, app_created_story, published_story, tagged_in_photo, approved_friend),
UFacebook.postStory - text from stories unintentionally generated by users, such as those generated when two people become friends, or when someone else posts on the person's wall,
UFacebook.postObjectID - the ID of any uploaded photo or video attached to the post,
UFacebook.postDescription - a description of a link in the post,
UFacebook.postCaption - a caption of a link/photo in the post,
UFacebook.postUpdatedTime - the time of the last change to the post, or the comments on it.
(read_stream and publish_action permissions required)
UFacebook.GetStatuses("user_id", limit) - returns only status updates posted by the user on his own wall,
UFacebook.statusID - the status message ID,
UFacebook.statusFromID - the ID of the user who posted the message,
UFacebook.statusFromName - the full name of the user who posted the message,
UFacebook.statusMessage - the status message content,
UFacebook.statusUpdatedTime - the time the message was published.
(user_photos permission required)
UFacebook.GetAlbums("user_id") - get all user albums,
UFacebook.albumID - the album ID,
UFacebook.albumName - the title of the album,
UFacebook.albumCount - number of photos in this album,
UFacebook.albumType - the type of the album (app, cover, profile, mobile, wall, normal, album),
UFacebook.albumCanUpload - whether the viewer can upload photos to this album.
UFacebook.GetPhotos("album_id") - get all photos in the album,
UFacebook.PutPhoto("album_id", "name", "source") - send a photo to the album,
name - brief description of the photo,
source - path or url of the photo,
UFacebook.photoID - the photo ID,
UFacebook.photoName - the user provided caption given to this photo,
UFacebook.photoSource - link to the image source of the photo,
UFacebook.photoUpdatedTime - the last time the photo or its caption was updated.
(manage_notifications permission required)
UFacebook.GetNotifications("user_id") - get unread facebook notifications,
UFacebook.ClearNotifications("user_id") - clear all pending notifications,
UFacebook.notifID - the notification's ID,
UFacebook.notifFromID - the ID (of the user, page, app, etc.) that 'sent', or is the source of the notification,
UFacebook.notifFromName - the full name (of the user, page, app, etc.) that 'sent', or is the source of the notification,
UFacebook.notifMessage - the message text in the notification,
UFacebook.notifTitle - the message title text in the notification,
UFacebook.notifType - the notification type,
UFacebook.notifObjectID - the object (this can be a post, a photo, a comment, etc.) that was the subject of the notification,
UFacebook.notifUpdatedTime - when the notification was last updated.
(read_mailbox permission required)
UFacebook.GetMessages("user_id", "mode") - get all unread or unseen messages, mode:
"unread" - get unread messages,
"unseen" - get unseen messages,
UFacebook.messageConversationID - the ID of a conversation, in a format similar to t_id.000000000000000,
UFacebook.messageFromID - the ID of the user who sent the message,
UFacebook.messageFromName - the ID of the user who sent the message,
UFacebook.messageMessage - the text of reply,
UFacebook.messageCreatedTime - when the notification was created.
(user_groups permission required)
UFacebook.GetGroups("user_id") - get user groups,
UFacebook.groupID - the group ID,
UFacebook.groupName - the name of the group.
(user_friends permission required)
Since April 30th, 2014 (FB API 2.0) friends list no longer includes the full list of a person's friends. Instead, it now returns the list of that person's friends who are also using your app.
UFacebook.GetFriends("user_id") - get friends using your app,
UFacebook.friendID - the friend's ID,
UFacebook.friendName - the name of the friend.
(user_events permission required)
UFacebook.GetEvents("user_id") - get user's events,
UFacebook.eventID - the event ID,
UFacebook.eventName - the name of the event,
UFacebook.eventLocation - the location of the event, if any,
UFacebook.eventStartTime - start time of the event,
UFacebook.eventEndTime - end time of the event,
UFacebook.eventDescription - long-form description of the event.
UFacebook.GetLikes("object_id") - get list of user's likes,
UFacebook.PutLike("object_id") - like something,
UFacebook.likeFromID - the like from ID,
UFacebook.likeFromName - the like from Name;.
UFacebook.GetComments("object_id") - get comments on object id,
UFacebook.PutComment("object_id", "message") - comment something,
UFacebook.commentFromID; - the ID of the user who commented,
UFacebook.commentFromName - the name of the user who commented,
UFacebook.commentMessage - comment text;.
UFacebook.DownloadContent("link", "path") - download content from the given link, eg. photo.