Interact with Twitter

Use these recipes to tweet and retweet messages, find followers and friends, get trending topics and locations, and look up status.

Note:

These recipes are available in the Integration Store as:
  • Oracle Twitter Find All Follower IDs
  • Oracle Twitter Find All Friend IDs
  • Oracle Twitter Find All Twitter IDs Who Retweeted
  • Oracle Twitter Find All Retweet My Tweets
  • Oracle Twitter Get All Twitter Trending Locations
  • Oracle Twitter Get All Twitter Trends Of Place
  • Oracle Twitter Lookup Tweet Status
  • Oracle Twitter Retweet
  • Oracle Twitter Tweet

Oracle provides these recipes as samples only. These recipes are meant only for guidance, and are not warranted to be error-free. No support is provided for these recipes.

Overview

Twitter is an online social networking service that enables you to send and read short messages called tweets. When you sign in to your Twitter account, you can read and post tweets.

The Twitter recipes use the REST Adapter and the Twitter Adapter to create an integration with a Twitter application. The recipes let you interact with Twitter including tweeting messages, finding followers and friends, and getting information about trends.

Recipe Name Description Parameters Required to Run Recipe

Tweet Message

Posts a tweet (a status update) on behalf of the user for all followers and others to read on Twitter.

Provide the status parameter with the desired text to be posted in the request message.

Retweet Message

Reposts or forwards a tweet that was previously posted on Twitter by another user.

Provide the ID parameter with the tweet ID to be retweeted.

Get Retweeted Messages

Returns the most recent tweets authored by the authenticating user that have been retweeted by other users.

Provide any value to the dummy parameter in the request message.

Get Followers IDs

Returns a cursored collection of user IDs for every user who is following the specified user.

Provide the user_id and the screen_name of the Twitter account in the request message.

Note that the screen_name is the Twitter ID without the @ sign.

Get Friends IDs

Returns a cursored collection of user IDs for every user who the specified user is following (otherwise known as their "friends").

Provide the user_id and the screen_name of the Twitter account in the request message.

Note that the screen_name is the Twitter ID without the @ sign.

Get IDs of Who Retweeted

Returns a collection of up to 100 user IDs belonging to users who have retweeted the tweet specified by the ID parameter.

Provide the ID parameter with the ID of a tweet in the request message.

Get Trends for Place

Returns the top 50 trending topics for the location specified by the Where On Earth Identifier (WOEID), if trending information is available for it.

Provide the ID parameter with the WOEID in the request message.

For example, you can enter 2367105 to get the trending topics for Boston, 2459115 for New York, or 2442047 for Los Angeles. Also, you can use 1 to get global trending topics.

Get Trends Available

Returns the locations that Twitter has trending topic information for.

The response is an array of "locations" that encode the location's WOEID and some other human-readable information such as a canonical name and country the location belongs in.

No parameter is required in the request message to run this recipe.

Look Up Tweet Status

Returns fully-hydrated tweet objects for up to 100 tweets per request, as specified by the comma-separated values passed to the ID parameter.

This recipe is useful to get the details of (hydrate) a collection of tweet IDs.

Provide the following parameters in the request message:

ID: Specifies the tweet ID.

trim_user: When set to true (true/t/1), then include only the status authors numeric ID. (Optional).

map: When used, tweets that don't exist or can't be viewed by the current user will still have their key represented but with an explicitly null value paired with it. (Optional).

System and Access Requirements

  • Oracle Integration

Prerequisites

To use the Twitter recipes, you must have a Twitter account and have access to the Twitter API for the integration. See Prerequisites for Creating a Connection in Using the Twitter Adapter with Oracle Integration.

Install, Configure, and Run the Recipes

For more information and steps to install, configure, and run recipes, see Get Started with Integration Accelerators and Recipes.

To use the collection of Twitter recipes, you must configure the Oracle REST Twitter Connection and the Oracle Twitter Connection. You only need to configure these connections once. All Twitter recipes use the same two connections.

You must supply the following information when you configure these connections.

Connection Name Parameters

Oracle REST Twitter Connection

Type: REST API Base URLConnection

URL: https://oracle_integration_server name:443

Security Policy: No security policy

Oracle Twitter Connection

The security policy grants you authorization access to the resources of the Twitter application. Configure the security for your Twitter connection by selecting the security policy and specifying the following parameters:

  • Consumer Key

  • Consumer Secret

  • Access Token

  • Access Secret

You would have copied and saved the security values when you authorized your application to use your Twitter account. See Prerequisites for Creating a Connection in Using the Twitter Adapter with Oracle Integration.