org.mule.modules

mule-module-twitter

2.3-SNAPSHOT
Namespacehttp://repository.mulesoft.org/releases/org/mule/modules/mule-module-twitter
Schema Locationhttp://repository.mulesoft.org/releases/org/mule/modules/mule-module-twitter/2.3/mule-twitter.xsd
Version2.3
Minimum Mule Version3.2

Module Overview

A Connector for Twitter which uses twitter4j.

Summary

Configuration
<twitter:config>
Configure an instance of this module
Message Processors
<twitter:create-place>
Creates a new place at the given latitude and longitude.
<twitter:destroy-status>
Destroys the status specified by the required ID parameter.
<twitter:get-current-trends>
Returns the current top 10 trending topics on Twitter.
<twitter:get-daily-trends>
Returns the top 20 trending topics for each hour in a given day.
<twitter:get-geo-details>
Find out more details of a place that was returned from the reverseGeoCode operation.
<twitter:get-home-timeline>
Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
<twitter:get-mentions>
Returns the 20 most recent mentions (status containing @username) for the authenticating user.
<twitter:get-public-timeline>
Returns the 20 most recent statuses from non-protected users who have set a custom user icon.
<twitter:get-retweeted-by>
Show user objects of up to 100 members who retweeted the status.
<twitter:get-retweeted-by-i-ds>
Show user ids of up to 100 users who retweeted the status represented by id
This method calls http://api.twitter.com/1/statuses/:id/retweeted_by/ids.format
<twitter:get-retweeted-by-me>
Returns the 20 most recent retweets posted by the authenticating user.
<twitter:get-retweeted-by-user-by-screen-name>
Returns the 20 most recent retweets posted by the specified user.
<twitter:get-retweeted-by-user-by-user-id>
Returns the 20 most recent retweets posted by the specified user.
<twitter:get-retweeted-to-me>
Returns the 20 most recent retweets posted by the authenticating user's friends.
<twitter:get-retweeted-to-user-by-screen-name>
Returns the 20 most recent retweets posted by users the specified user follows.
<twitter:get-retweeted-to-user-by-user-id>
Returns the 20 most recent retweets posted by users the specified user follows.
<twitter:get-retweets>
Returns up to 100 of the first retweets of a given tweet.
<twitter:get-retweets-of-me>
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
<twitter:get-trends>
Returns the top ten topics that are currently trending on Twitter.
<twitter:get-user-timeline>
Returns the 20 most recent statuses posted from the authenticating user.
<twitter:get-user-timeline-by-screen-name>
Returns the 20 most recent statuses posted from the authenticating user.
<twitter:get-user-timeline-by-user-id>
Returns the 20 most recent statuses posted from the authenticating user.
<twitter:get-weekly-trends>
Returns the top 30 trending topics for each day in a given week.
<twitter:request-authorization>
Start the OAuth request authorization process.
<twitter:retweet-status>
Retweets a tweet.
<twitter:reverse-geo-code>
Search for places (cities and neighborhoods) that can be attached to a statuses/update.
<twitter:search>
Returns tweets that match a specified query.
<twitter:search-places>
Search for places that can be attached to a statuses/update.
<twitter:set-oauth-verifier>
Set the OAuth verifier after it has been retrieved via requestAuthorization.
<twitter:show-status>
Returns a single status, specified by the id parameter below.
<twitter:show-user>
Answers user information for the authenticated user
<twitter:update-status>
Updates the authenticating user's status.
Message Sources
<twitter:filtered-stream>
Asynchronously retrieves public statuses that match one or more filter predicates.
<twitter:fireshorse-stream>
Asynchronously retrieves all public statuses.
<twitter:link-stream>
Asynchronously retrieves all statuses containing 'http:' and 'https:'.
<twitter:sample-stream>
Asynchronously retrieves a random sample of all public statuses.
<twitter:site-stream>
Asynchronously retrieves statutes for a set of supplied user's ids.
<twitter:user-stream>
Retrieves the following user updates notifications:
- New Statuses
- Block/Unblock events
- Follow events
- User profile updates
- Retweets
- List creation/deletion
- List member addition/remotion
- List subscription/unsubscription
- List updates
- Profile updates
Such notifications are represented as org.mule.twitter.UserEvent objects Only one Twitter stream can be consumed using the same credentials.

Configuration

To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:twitter="http://repository.mulesoft.org/releases/org/mule/modules/mule-module-twitter"
      xsi:schemaLocation="
               http://www.mulesoft.org/schema/mule/core
               http://www.mulesoft.org/schema/mule/core/current/mule.xsd
               http://repository.mulesoft.org/releases/org/mule/modules/mule-module-twitter
               http://repository.mulesoft.org/releases/org/mule/modules/mule-module-twitter/2.3/mule-twitter.xsd">

      <!-- here goes your flows and configuration elements -->

</mule>

This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necesary as long as each carries its own name.

Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.

Attributes
TypeNameDefault ValueDescription
xs:string name Optional. Give a name to this configuration so it can be later referenced.
xs:string accessKey Optional. 
xs:string accessSecret Optional. 
xs:string consumerKey
xs:string consumerSecret
xs:boolean useSSL true Optional. 

Message Processors

<twitter:create-place>

Creates a new place at the given latitude and longitude.
<create-place token="#[header:token]" containedWithin="#[header:containedWithin]" name="#[header:placeName]" latitude="#[header:latitude]" longitude="#[header:longitude]" streetAddress="[header:address]"/>

Attributes
config-ref Optional. Specify which configuration to use.
name The name a place is known as.
containedWithin The place_id within which the new place can be found. Try and be as close as possible with the containing place. For example, for a room in a building, set the contained_within as the building place_id.
token The token found in the response from geo/similar_places.
latitude The latitude the place is located at.
longitude The longitude the place is located at.
streetAddress Optional. optional: This parameter searches for places which have this given street address. There are other well-known, and application specific attributes available. Custom attributes are also permitted. Learn more about Place Attributes.
Child Elements
Return Payload
  • a new Place
Exception Payload
TwitterException

<twitter:destroy-status>

Destroys the status specified by the required ID parameter.
Usage note: The authenticating user must be the author of the specified status.
This method calls http://api.twitter.com/1/statuses/destroy

Attributes
config-ref Optional. Specify which configuration to use.
statusId The ID of the status to destroy.
Child Elements
Return Payload
  • the deleted status
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-current-trends>

Returns the current top 10 trending topics on Twitter. The response includes the time of the request, the name of each trending topic, and query used on Twitter Search results page for that topic.
<get-current-trends excludeHashtags="true" />

Attributes
config-ref Optional. Specify which configuration to use.
excludeHashtags Optional. whether all hashtags shoudl be removed from the trends list.
Child Elements
Return Payload
  • a Trends object
Exception Payload
TwitterException

<twitter:get-daily-trends>

Returns the top 20 trending topics for each hour in a given day.
<get-daily-trends />

Attributes
config-ref Optional. Specify which configuration to use.
date Optional. starting date of daily trends. If no date is specified, current date is used
excludeHashTags Optional. whether hashtags should be excluded
Child Elements
Return Payload
  • a list of Trends objects
Exception Payload
TwitterException

<twitter:get-geo-details>

Find out more details of a place that was returned from the reverseGeoCode operation.
<get-geo-details id="#[header:geocodeId]"/>

Attributes
config-ref Optional. Specify which configuration to use.
id The ID of the location to query about.
Child Elements
Return Payload
  • a Place
Exception Payload
TwitterException

<twitter:get-home-timeline>

Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web.
Usage note: This home_timeline call is identical to statuses/friends_timeline, except that home_timeline also contains retweets, while statuses/friends_timeline does not for backwards compatibility reasons. In a future version of the API, statuses/friends_timeline will be deprected and replaced by home_timeline.
This method calls http://api.twitter.com/1/statuses/home_timeline

Attributes
config-ref Optional. Specify which configuration to use.
page 1 controls pagination. Supports since_id, max_id, count and page parameters.
count 100
sinceId -1
Child Elements
Return Payload
  • list of the home Timeline
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-mentions>

Returns the 20 most recent mentions (status containing @username) for the authenticating user.
This method calls http://api.twitter.com/1/statuses/mentions

Attributes
config-ref Optional. Specify which configuration to use.
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • the 20 most recent replies
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-public-timeline>

Returns the 20 most recent statuses from non-protected users who have set a custom user icon. The public timeline is cached for 60 seconds and requesting it more often than that is unproductive and a waste of resources.
This method calls http://api.twitter.com/1/statuses/public_timeline

Attributes
config-ref Optional. Specify which configuration to use.
Child Elements
Return Payload
  • list of statuses of the Public Timeline
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweeted-by>

Show user objects of up to 100 members who retweeted the status.
This method calls http://api.twitter.com/1/statuses/:id/retweeted_by

Attributes
config-ref Optional. Specify which configuration to use.
statusId The ID of the status you want to get retweeters of
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • the list of users who retweeted your status
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweeted-by-i-ds>

Show user ids of up to 100 users who retweeted the status represented by id
This method calls http://api.twitter.com/1/statuses/:id/retweeted_by/ids.format

Attributes
config-ref Optional. Specify which configuration to use.
statusId The ID of the status you want to get retweeters of
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • IDs of users who retweeted the stats
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweeted-by-me>

Returns the 20 most recent retweets posted by the authenticating user.
This method calls http://api.twitter.com/1/statuses/retweeted_by_me

Attributes
config-ref Optional. Specify which configuration to use.
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • the 20 most recent retweets posted by the authenticating user
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweeted-by-user-by-screen-name>

Returns the 20 most recent retweets posted by the specified user. This method is identical to statuses/retweeted_by_me except you can choose the user to view.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/statuses/retweeted_by_user

Attributes
config-ref Optional. Specify which configuration to use.
screenName the user to view
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • the 20 most recent retweets posted by the authenticating user
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweeted-by-user-by-user-id>

Returns the 20 most recent retweets posted by the specified user. This method is identical to statuses/retweeted_by_me except you can choose the user to view.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/statuses/retweeted_by_user

Attributes
config-ref Optional. Specify which configuration to use.
userId the user to view
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • the 20 most recent retweets posted by the authenticating user
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweeted-to-me>

Returns the 20 most recent retweets posted by the authenticating user's friends.
This method calls http://api.twitter.com/1/statuses/retweeted_to_me

Attributes
config-ref Optional. Specify which configuration to use.
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • the 20 most recent retweets posted by the authenticating user's friends.
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweeted-to-user-by-screen-name>

Returns the 20 most recent retweets posted by users the specified user follows. This method is identical to statuses/retweeted_to_me except you can choose the user to view.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/statuses/retweeted_to_user

Attributes
config-ref Optional. Specify which configuration to use.
screenName the user to view
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • the 20 most recent retweets posted by the authenticating user's friends.
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweeted-to-user-by-user-id>

Returns the 20 most recent retweets posted by users the specified user follows. This method is identical to statuses/retweeted_to_me except you can choose the user to view.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/statuses/retweeted_to_user

Attributes
config-ref Optional. Specify which configuration to use.
userId the user to view
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • the 20 most recent retweets posted by the authenticating user's friends.
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweets>

Returns up to 100 of the first retweets of a given tweet.
This method calls http://api.twitter.com/1/statuses/retweets

Attributes
config-ref Optional. Specify which configuration to use.
statusId The numerical ID of the tweet you want the retweets of.
Child Elements
Return Payload
  • the retweets of a given tweet
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-retweets-of-me>

Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
This method calls http://api.twitter.com/1/statuses/retweets_of_me

Attributes
config-ref Optional. Specify which configuration to use.
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • the 20 most recent tweets of the authenticated user that have been retweeted by others.
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-trends>

Returns the top ten topics that are currently trending on Twitter. The response includes the time of the request, the name of each trend, and the url to the Twitter Search results page for that topic.
<get-trends/>

Attributes
config-ref Optional. Specify which configuration to use.
Child Elements
Return Payload
  • a Trends object
Exception Payload
TwitterException

<twitter:get-user-timeline>

Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
This is the equivalent of the Web / page for your own user, or the profile page for a third party.
For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.

This method calls http://api.twitter.com/1/statuses/user_timeline.json

Attributes
config-ref Optional. Specify which configuration to use.
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • list of the user Timeline
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-user-timeline-by-screen-name>

Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
This is the equivalent of the Web / page for your own user, or the profile page for a third party.
For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.

This method calls http://api.twitter.com/1/statuses/user_timeline.json

Attributes
config-ref Optional. Specify which configuration to use.
screenName specifies the screen name of the user for whom to return the user_timeline
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • list of the user Timeline
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-user-timeline-by-user-id>

Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
This is the equivalent of the Web / page for your own user, or the profile page for a third party.
For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.

This method calls http://api.twitter.com/1/statuses/user_timeline.json

Attributes
config-ref Optional. Specify which configuration to use.
userId specifies the ID of the user for whom to return the user_timeline
page 1
count 100
sinceId -1
Child Elements
Return Payload
  • list of the user Timeline
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:get-weekly-trends>

Returns the top 30 trending topics for each day in a given week.
<get-weekly-trends/>

Attributes
config-ref Optional. Specify which configuration to use.
date Optional. starting date of daily trends. If no date is specified, current date is used
excludeHashTags Optional. if all hashtags should be removed from the trends list.
Child Elements
Return Payload
  • a list of Trends objects
Exception Payload
TwitterException

<twitter:request-authorization>

Start the OAuth request authorization process.

Attributes
config-ref Optional. Specify which configuration to use.
callbackUrl Optional. 
Child Elements
Return Payload
  • The user authorization URL.
Exception Payload
TwitterException

<twitter:retweet-status>

Retweets a tweet. Returns the original tweet with retweet details embedded.
This method calls http://api.twitter.com/1/statuses/retweet

Attributes
config-ref Optional. Specify which configuration to use.
statusId The ID of the status to retweet.
Child Elements
Return Payload
  • the retweeted status
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:reverse-geo-code>

Search for places (cities and neighborhoods) that can be attached to a statuses/update. Given a latitude and a longitude, return a list of all the valid places that can be used as a place_id when updating a status. Conceptually, a query can be made from the user's location, retrieve a list of places, have the user validate the location he or she is at, and then send the ID of this location up with a call to statuses/update.
There are multiple granularities of places that can be returned -- "neighborhoods", "cities", etc. At this time, only United States data is available through this method.
<reverse-geo-code ip="#[header:ip]" />

Attributes
config-ref Optional. Specify which configuration to use.
latitude Optional. latitude coordinate. Mandatory if ip is not specified
longitude Optional. longitude coordinate.
ip Optional. the ip. Mandatory if coordinates are not specified
Child Elements
Return Payload
  • a ResponseList of Place
Exception Payload
TwitterException

<twitter:search>

Returns tweets that match a specified query.

This method calls http://search.twitter.com/search.json
@return

Attributes
config-ref Optional. Specify which configuration to use.
query The search query.
Child Elements
Exception Payload
TwitterException

<twitter:search-places>

Search for places that can be attached to a statuses/update. Given a latitude and a longitude pair, or and IP address, this request will return a list of all the valid places that can be used as the place_id when updating a status.
<search-places latitude="#[header:latitude]" longitude="#[header:longitude]" />

Attributes
config-ref Optional. Specify which configuration to use.
latitude Optional. latitude coordinate. Mandatory if ip is not specified
longitude Optional. longitude coordinate.
ip Optional. the ip. Mandatory if coordinates are not specified
Child Elements
Return Payload
  • a ResponseList of Place
Exception Payload
TwitterException

<twitter:set-oauth-verifier>

Set the OAuth verifier after it has been retrieved via requestAuthorization. The resulting access tokens will be logged to the INFO level so the user can reuse them as part of the configuration in the future if desired.

Attributes
config-ref Optional. Specify which configuration to use.
oauthVerifier The OAuth verifier code from Twitter.
Child Elements
Exception Payload
TwitterException

<twitter:show-status>

Returns a single status, specified by the id parameter below. The status's author will be returned inline.
This method calls http://api.twitter.com/1/statuses/show

Attributes
config-ref Optional. Specify which configuration to use.
id the numerical ID of the status you're trying to retrieve
Child Elements
Return Payload
  • a single status
Exception Payload
TwitterException when Twitter service or network is unavailable

<twitter:show-user>

Answers user information for the authenticated user

Attributes
config-ref Optional. Specify which configuration to use.
Child Elements
Return Payload
  • a User object
Exception Payload
TwitterException

<twitter:update-status>

Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates.
This method calls http://api.twitter.com/1/statuses/update

Attributes
config-ref Optional. Specify which configuration to use.
status the text of your status update
inReplyTo Optional. 
geoLocation Optional. 
Child Elements
Return Payload
  • the latest status
Exception Payload
TwitterException when Twitter service or network is unavailable

Message Sources

<twitter:filtered-stream>

Asynchronously retrieves public statuses that match one or more filter predicates. At least a keyword or userId must be specified. Multiple parameters may be specified. Placing long parameters in the URL may cause the request to be rejected for excessive URL length. The default access level allows up to 200 track keywords and 400 follow userids. Only one Twitter stream can be consumed using the same credentials. As a consequence, only one twitter stream can be consumed per connector instance.
<filtered-stream count="5"> <keywords> <keyword>enterprise</keyword> <keyword>integration</keyword> </keywords> </filtered-stream>

Attributes
config-ref Optional. Specify which configuration to use.
count Optional. the number of previous statuses to stream before transitioning to the live stream.
userIds Optional. the user ids to follow
keywords Optional. the keywords to track
callback
Child Elements

<twitter:fireshorse-stream>

Asynchronously retrieves all public statuses. This stream is not generally available - it requires special permissions and its usage is discouraged by Twitter Only one Twitter stream can be consumed using the same credentials. As a consequence, only one twitter stream can be consumed per connector instance.

Attributes
config-ref Optional. Specify which configuration to use.
count
callback
Child Elements

<twitter:link-stream>

Asynchronously retrieves all statuses containing 'http:' and 'https:'. Like Firehorse, its is not a generally available stream Only one Twitter stream can be consumed using the same credentials. As a consequence, only one twitter stream can be consumed per connector instance.

Attributes
config-ref Optional. Specify which configuration to use.
count
callback
Child Elements

<twitter:sample-stream>

Asynchronously retrieves a random sample of all public statuses. The sample size and quality varies depending on the account permissions The default access level provides a small proportion of the Firehose. The "Gardenhose" access level provides a proportion more suitable for data mining and research applications that desire a larger proportion to be statistically significant sample. Only one Twitter stream can be consumed using the same credentials. As a consequence, only one twitter stream can be consumed per connector instance.
<sample-stream/>

Attributes
config-ref Optional. Specify which configuration to use.
callback
Child Elements

<twitter:site-stream>

Asynchronously retrieves statutes for a set of supplied user's ids. Site Streams are a beta service, so refer always to latest twitter documentation about them. Only one Twitter stream can be consumed using the same credentials. As a consequence, only one twitter stream can be consumed per connector instance.

Attributes
config-ref Optional. Specify which configuration to use.
userIds ids of users to include in the stream
withFollowings Optional. withFollowings whether to receive status updates from people following
callback_
Child Elements

<twitter:user-stream>

Retrieves the following user updates notifications:
- New Statuses
- Block/Unblock events
- Follow events
- User profile updates
- Retweets
- List creation/deletion
- List member addition/remotion
- List subscription/unsubscription
- List updates
- Profile updates
Such notifications are represented as org.mule.twitter.UserEvent objects Only one Twitter stream can be consumed using the same credentials. As a consequence, only one twitter stream can be consumed per connector instance.
<user-stream> <keywords> <keyword>enterprise</keyword> <keyword>integration</keyword> </keywords> </user-stream>

Attributes
config-ref Optional. Specify which configuration to use.
keywords the keywords to track for new statuses
callback_
Child Elements