Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)
WOLFRAM LANGUAGE SERVICE CONNECTION

Facebook

Connect your Facebook account to the Wolfram Language to analyze Facebook data like friends, comments, likes, and photos. Also post messages directly from the Wolfram Language.

Connecting & AuthenticatingConnecting & Authenticating

    ServiceConnect["Facebook"] creates a connection to the Facebook API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.
    Some requests require different permissions than those granted during authentication. The user will be asked to grant each additional permission when it is required. Some data may be unavailable, based on Facebook privacy settings.

RequestsRequests

    ServiceExecute[conn,"request",params] sends a request to the connection identified by conn, using parameters params. The following give possible requests.

    User Information

    Requests:

    "UserData" profile information for the specified user

    "Picture" profile picture

    "Photos" uploaded photos

    "Places" places to which the user has checked in

    "PictureLink"  ▪  "PhotoLinks"  ▪  "Family"  ▪  "Bio"  ▪  "Birthday"  ▪  "Cover"  ▪  "CoverLink"  ▪  "Education"  ▪  "Work"  ▪  "Movies"  ▪  "Music"  ▪  "Books"  ▪  "FavoriteAthletes"  ▪  "FavoriteTeams"  ▪  "InterestedIn"  ▪  "RelationshipStatus"  ▪  "SignificantOther"  ▪  "Languages"  ▪  "Email"  ▪  "Website"  ▪  "Link"  ▪  "Hometown"  ▪  "Location"  ▪  "FirstName"  ▪  "MiddleName"  ▪  "LastName"  ▪  "FullName"  ▪  "Username"  ▪  "UserID"  ▪  "Gender"  ▪  "Political"  ▪  "Religion"  ▪  "Quotes"  ▪  "Currency"  ▪  "Devices"  ▪  "UpdatedTime"  ▪  "Locale"  ▪  "Timezone"  ▪  "SecuritySettings"  ▪  "ThirdPartyID"  ▪  "Verified"  ▪  "VideoUploadLimits"  ▪  "WolframConnectedQ"

    Parameters:
  • "UserID"authenticated useruser ID
  • Sending Posts

    Requests:

    "PostMessage" post a message on the authenticated user's wall

    "PostLink" post a link on the authenticated user's wall

    Parameters:
  • "Message"""message to post
    "Link"Nonelink URL to post
  • User Wall Posts

    Requests:

    "Posts" posts made by the specified user

    "PostEventSeries" event series of the user's posts

    "PostTimeline" timeline plot of the user's posts

    "Feeds" posts on the user's wall

    "WallWordFrequencies" frequency of words in posts on the user's wall

    "WallTopCommenter" number of comments other users made on the user's wall

    "WallMostLikedPost" message from the user's most-liked post

    "WallMostLikedPostData" data about the user's most-liked post

    "WallMostCommentedPost" message from the user's most-liked post

    "WallMostCommentedPostData" data about the user's most-liked post

    "WallPostStatistics" comment and like data about posts on the user's wall

    "WallPostLength" monthly post lengths on a user's wall

    "WallPostLengthTimeline" timeline plot of monthly post lengths

    "WallWeeklyAppActivity" plot of when apps have posted on the user's wall

    Parameters:
  • "UserID"authenticated useruser ID
    "Limit"500limit of returned posts
  • User Wall Comments and Likes

    Requests:

    "CommentNetwork" graph showing which users comment on the same posts

    "LikeNetwork" graph showing which users like the same posts

    "LikeCommentNetwork" graph of which users comment on or like the same posts

    "PostCommentNetwork" graph showing which posts share common commenters

    "PostLikeNetwork" graph showing which posts share common likers

    "PostLikeCommentNetwork" graph showing common commenters and likers

    "BimodalCommentNetwork" graph of users and posts connected by comments

    "BimodalLikeNetwork" graph of users and posts connected by likes

    "BimodalLikeCommentNetwork" graph of users and posts connected by comments and likes

    Parameters:
  • "Limit"1000limit of returned comments
  • User Wall Activity Types

    Requests:

    "ActivityTypes" pie chart showing the type of activity on the user's wall

    "ActivityWeeklyDistribution" timing of activity types on the user's wall

    "ActivityRecentHistory" plot monthly frequency of activity types

    Parameters:
  • "UserID"authenticated useruser ID
    "Limit"500limit of returned posts
  • Friends

    Requests:

    "Friends" names of the authenticated user's friends

    "FriendIDs" user IDs of the authenticated user's friends

    "FriendNetwork" graph of friendships between the user's friends

    Parameters:
  • "Limit"500limit of returned friends
  • Mutual Friends

    Requests:

    "MutualFriends" common friends of the authenticated and specified users

    "MutualFriendIDs" user IDs of the mutual friends

    Parameters:
  • "UserID"(required)user ID
    "Limit"500limit of returned friends
  • Page Data

    Requests:

    "Description" description of the page

    "Likes" number of likes the page has received

    "Checkins" number of check-ins the page has received

    "WereHereCount" how many people have visited the page

    "Link" page's Facebook URL

    "Website" page's URL

    "TalkingAboutCount" number of people mentioning the page

    "PageName" name of the page

    "Username"  ▪  "Birthday" "Location"  ▪  "RestaurantSpecialties"  ▪  "RestaurantServices"  ▪  "Parking"  ▪  "Phone"  ▪  "PriceRange"  ▪  "Attire"  ▪  "DirectedBy"  ▪  "CompanyOverview"  ▪  "Mission"  ▪  "Products"  ▪  "PressContact"  ▪  "Founded"  ▪  "BandMembers"  ▪  "Hometown"  ▪  "GeneralManager"  ▪  "CurrentLocation"  ▪  "BookingAgent"  ▪  "About"  ▪  "PageData"  ▪  "Category"  ▪  "CategoryList"  ▪  "BestPage"  ▪  "Cover"  ▪  "CoverLink"  ▪  "CanPost"  ▪  "IsUnclaimed"  ▪  "IsPublished"  ▪  "GeneralInfo"  ▪  "PageID"

    Parameters:
  • "PageID"(required)Facebook page ID
  • Page Tags

    Requests:

    "TaggedPosts" a list of posts from the specified page

    "TaggedPhotos" a list of photos posted on the page

    "TaggedVideos" a list of thumbnail links to videos posted on the page

    Parameters:
  • "PageID"(required)Facebook page ID
  • Connection Information

    Requests:

    "PermissionList" permissions granted to the connection by Facebook

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Create a new connection by launching an authentication dialog:

In[1]:=
Click for copyable input
Out[1]=

Get information about a user's education:

In[2]:=
Click for copyable input
Out[2]=

Create a graph of posts, where edges represent common commenters:

In[3]:=
Click for copyable input
Out[3]=