Twitter

  • Description

      Twitter

      The twitter component is a non-visible component that enables communication with Twitter. Once a user has logged into their Twitter account (and the authorization has been confirmed successful by the IsAuthorized event).

  • Events

    • Direct Messages Received (list messages)
    • This event is raised when the recent messages requested through 'RequestDirectMessages' have been retrieved. A list of the messages can then be found in the 'messages' parameter or the 'Messages' property.
    • Followers Received (list followers)
    • This event is raised when all of the followers of the logged-in user requested through 'RequestFollowers' have been retrieved. A list of the followers can then be found in the 'followers' parameter or the 'Followers' property.
    • Friend Timeline Received (list timeline)
    • This event is raised when the messages requested through 'RequestFriendTimeline' have been retrieved. The 'timeline' parameter and the 'Timeline' property will contain a list of lists, where each sub-list contains a status update of the form (username message).
    • Is Authorized
    • This event is raised after the program calls 'Authorize' procedure if the authorization was successful. It is also called after a call to 'CheckAuthorized' procedure if we already have a valid access token. After this event has been raised, any other method for this component can be called.
    • Mentions Received (list mentions)
    • This event is raised when the mentions of the logged-in user requested through 'RequestMentions' have been retrieved. A list of the mentions can then be found in the 'mentions' parameter or the 'Mentions' property.
    • Search Successful (list searchResults)
    • This event is raised when the results of the search requested through 'SearchSuccessful' have been retrieved. A list of the results can then be found in the results 'parameter' or the 'Results' property.
  • Procedures

    • Authorize
    • This method redirects user to login to Twitter via the Web browser using the OAuth protocol if we don't already have authorization.
    • Check Authorized
    • This method checks whether we already have access, and if so, causes 'IsAuthorized' event handler to be called.
    • DeAuthorize
    • This method removes Twitter authorization from this running app instance.
    • DirectMessage (text user, text message)
    • This method sends a direct (private) message to the specified user. The message will be trimmed if it exceeds 160 characters.
    • Login (text user, text pw)
    • This method allows you to log on to twitter.
    • Follow (text user)
    • This method starts following a user.
    • Request Direct Messages
    • This method requests the 20 most recent direct messages sent to the logged-in user. When the messages have been retrieved, the system will raise the 'DirectMessagesReceived' event and set the 'DirectMessages' property to the list of messages.
    • Request Followers
    • This method gets who is following you.
    • Request Friend Timeline
    • This method gets the most recent 20 messages in the user's timeline.
    • Request Mentions
    • This method requests the 20 most recent mentions of the logged-in user. When the mentions have been retrieved, the system will raise the 'MentionsReceived' event and set the 'Mentions' property to the list of mentions.
    • Search Twitter (text query)
    • This method searches Twitter for the given String query.
    • Stop Following (text user)
    • This method stops following a user.
    • Tweet (text status)
    • This method sends a tweet as the logged-in user with the specified Text, which will be trimmed if it exceeds 160 characters.
    • Tweet With Image (text status, text imagePath)
    • This method sends a tweet as the logged-in user with the specified Text and a path to the image to be uploaded, which will be trimmed if it exceeds 160 characters. If an image is not found or invalid, the update will not be sent.
  • Properties

    • Consumer Key
    • The the consumer key to be used when authorizing with Twitter via OAuth.
    • ConsumerSecret
    • The consumer secret to be used when authorizing with Twitter via OAuth.
    • Direct Messages
    • This property contains a list of the most recent messages mentioning the logged-in user. Initially, the list is empty. To set it, the program must:
      • 1. Call the Authorize method.
      • 2. Wait for the Authorized event.
      • 3. Call the RequestDirectMessages method.
      • 4. Wait for the DirectMessagesReceived event.
      The value of this property will then be set to the list of direct messages retrieved (and maintain that value until any subsequent call to RequestDirectMessages).
    • Followers
    • This property contains a list of the followers of the logged-in user. Initially, the list is empty. To set it, the program must:
      • 1. Call the Authorize method.
      • 2. Wait for the Authorized event.
      • 3. Call the RequestFollowers method.
      • 4. Wait for the FollowersReceived event.
      The value of this property will then be set to the list of followers (and maintain its value until any subsequent call to RequestFollowers).
    • Friend Timeline
    • This property contains the 20 most recent messages of users being followed. Initially, the list is empty. To set it, the program must:
      • 1. Call the Authorize method.
      • 2. Wait for the Authorized event.
      • 3. Specify users to follow with one or more calls to the Follow method.
      • 4. Call the RequestFriendTimeline method.
      • 5. Wait for the FriendTimelineReceived event.
      The value of this property will then be set to the list of messages (and maintain its value until any subsequent call to RequestFriendTimeline.
    • Mentions
    • This property contains a list of mentions of the logged-in user. Initially, the list is empty. To set it, the program must:
      • 1. Call the Authorize method.
      • 2. Wait for the Authorized event.
      • 3. Call the RequestMentions method.
      • 4. Wait for the MentionsReceived event.
      The value of this property will then be set to the list of mentions (and will maintain its value until any subsequent calls to RequestMentions).
    • Search Results
    • This property, which is initially empty, is set to a list of search results after the program:
      • 1. Calls the SearchTwitter method.
      • 2. Waits for the SearchSuccessful event.
      The value of the property will then be the same as the parameter to SearchSuccessful. Note that it is not necessary to call the Authorize method before calling SearchTwitter.
    • Username
    • The user name of the authorized user. Empty if there is no authorized user.