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

Twitter

Connect your Twitter account to the Wolfram Language to analyze Twitter data like tweets, retweets, replies, and followers. Also send tweets directly from the Wolfram Language.

Connecting & AuthenticatingConnecting & Authenticating

    ServiceConnect["Twitter"] creates a connection to the Twitter API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.

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 any user

    "UserMentions" list of user handles included in a timeline

    "UserReplies" user's replies

    "UserHashtags" hashtags in user's tweets

    "LastTweet" user's latest tweet

    Parameters:
  • "ScreenName"authenticated userthe Twitter name
    "UserID"authenticated userthe user ID number
    "Count"200number of tweets to return
    "SinceID"Noneearliest tweet ID to use
    "MaxID"Nonelatest tweet ID to use
  • Friends and Followers Information

    Requests:

    "Friends" who a user is following

    "Followers" who is following a user

    "FollowerNetwork" graph of which of the user's followers follow each other

    "FollowerMentionNetwork" graph of which followers mention each other

    "FollowerReplyToNetwork" graph of which followers reply to each other

    "FriendIDs"  ▪  "FollowerIDs"  ▪  "FriendNetwork"  ▪  "FriendMentionNetwork"  ▪  "FriendReplyToNetwork"

    Parameters:
  • "ScreenName"authenticated userthe Twitter name
    "UserID"authenticated userthe user ID number
    "Count"200number of tweets to return
  • Sending Tweets

    "Tweet" send a tweet

    "ImageTweet" post an image in a tweet

    These requests support the following parameters:
  • "Message"Nonemessage to send
    "Image"Noneimage to upload ( only)
    "InReplyToStatusID"Nonetweet ID being replied to
    "GeoPosition"Nonelocation of the tweet
  • Retrieving Tweets

    "GetTweet" get a tweet

  • "TweetID"(required)tweet ID to be retrieved
  • Content Search & Followers

    "UserIDSearch" find user IDs associated with a specified content search string

    "SearchNetwork" follower network based on a specified content search string

    "SearchMentionNetwork"  ▪  "SearchReplyToNetwork"

    The following parameters apply to network requests:
  • "Count"200number of users to return
    "Query"(required)search string
  • Access Information

    "RateLimit" check number of available and used requests for this connection

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 user profile information about the authenticated user:

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

Get profile information about a different user:

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