Contact Us 1-800-596-4880

Twitter Cloud Connector Reference

twitter
 +
*Purpose:* The Twitter Cloud Connector enables a Mule application to access the Twitter social networking APIs.

Minimum Configuration: The configuration reference, Config reference, found under the General tab. Because the configuration reference refers to a global element, you should have previously set up a Twitter global element in Mule Studio. You also need to create a Twitter account and register your application to get the Twitter authorization credentials.

Discussion: You must first set up an account on Twitter, which you do through the Twitter web site, and register your application. You need to do this to obtain the required authorization (Oauth) and consumer keys that you enter when creating the Twitter global element or configuring the Twitter cloud component. These authorization keys are specific to a user.

  • For details on setting up a Twitter account, see the Twitter sign up page.

  • After you set up a Twitter account, you must register the new application with Twitter.

Once you complete the Twitter account set-up and registration, you should have the following pieces of information needed to complete the configuration of the Twitter global element:

  • Oauth Token: oauthToken

  • Oaugh Token Secret: oauthTokenSecret

  • Consumer Key: consumerKey

  • Consumer Secret: consumerSecret

You also must create a Mule Studio global element for the Twitter cloud connector. You can do so from the Global Element pane prior to dropping the Twitter Cloud Connector on the canvas. You can also do this from within the Twitter Pattern Properties dialog when configuring the cloud connector.

Note that the authorization keys (oauthToken and oauthTokenSecret) are only required if your application updates or sends information. There is no need for these two authorization credentials if your application only searches for Twitter posts and does not perform any logging operations. Applications performing only search operations as well as those that perform logging operations do need to configure the consumerKey and consumerSecret properties.

Configure Twitter properties from the General tab in the Twitter Pattern Properties dialog:

twitter1

Select the Operation from the Operation property pull-down list. The configurable properties shown at the bottom of the pane change depending on the operation you select. For example, if you select the operation Update status, then you enter the expected Status property, as shown above.

The figure below shows the same properties dialog when you select the Search operation.

+ image::twitter-dialog2.png[]

+

Notice that you can enter a number of search parameters, of which the search Query is required.

The [Reference Documentation] below covers the different configurable properties for each type of operation.

For Config reference, select the Twitter global element from the field’s pull-down list. Use the Add or Edit buttons to add or edit a global element.

In the Authentication section, enter the consumerKey and consumerSecret values supplied by Twitter in the respective Consumer Key and Consumer Secret fields. You may have set these values in the Twitter global element. If so, you can leave them blank here and use the values from the Twitter global element, or you can enter new values here and thus change them for this particular Twitter instance.

Twitter Global Element
Click the Add button next to the Config reference field in the Pattern Properties dialog to create a Twitter global element. (You can also do this from the Global Elements pane.) If you have selected a Twitter global element from the Config reference pull-down list, you can click the Edit button to modify configuration values in that global element.

twitter ge
  • Under the Twitter Configuration tab, select the data format for exchanging data with Twitter.

  • In the Authentication section, do the following:

    • Enter the Oauth Token and Oauth Token Secret values supplied by Twitter. These are required if your application logs data.

    • Enter the Consumer Key and Consumer Secret values supplied by Twitter. These are required for applications that log data or merely perform searches.