Integrating with Twitter using Mule ESB Twitter Connector

12
Integration with Twitter using Mule ESB Twitter Connector Prepared By: Rupesh Sinha

Transcript of Integrating with Twitter using Mule ESB Twitter Connector

Page 1: Integrating with Twitter using Mule ESB Twitter Connector

Integration with Twitter using

Mule ESB Twitter Connector

Prepared By: Rupesh Sinha

Page 2: Integrating with Twitter using Mule ESB Twitter Connector

Overview

What is Twitter?

Versions and Assumptions

Configuring Twitter App

Configuring Twitter Connector

Mule Flow to connect to Twitter and retrieve

user details

Testing and Observation

Page 3: Integrating with Twitter using Mule ESB Twitter Connector

What is Twitter?

− Twitter is an online social networking service that enables users to

send and read short 140-character messages called "tweets"

− Twitter was created in March 2006 by Jack Dorsey, Evan

Williams, Biz Stone and Noah Glass and launched by July 2006

− Registered users can read and post tweets, but unregistered users

can only read them

− Twitter Inc. is based in San Francisco and has more than 25 offices

around the world

− Users access Twitter through the website interface, SMS, or mobile

device app

− In 2013 Twitter was one of the ten most-visited websites, and has

been described as "the SMS of the Internet

− As of December 2014, Twitter has more than 500 million users, out

of which more than 284 million are active users

Source- Wikipedia

Page 4: Integrating with Twitter using Mule ESB Twitter Connector

Versions and Assumptions

In this presentation, we are using

Twitter Connector 3.2.0

Anypoint Studio

Mule ESB Server 3.5.2

To use this application in your project, you will need a Twitter

account for testing

You will need to create a new Twitter app under Twitter

developer apps to be able to communicate with your Twitter

account from Mule ESB application

Page 5: Integrating with Twitter using Mule ESB Twitter Connector

Configuring Twitter App

Go to https://apps.twitter.com/

Sign in and click on Create New App button

Fill the form and click on Create your Twitter application button. A sample

form is given below

Page 6: Integrating with Twitter using Mule ESB Twitter Connector

Click on Keys and Access Tokens tab

Click on Create my Access Tokens

Make a note of Consumer Key, Consumer Secret, Access Token

and Access Token Secret.

These keys will be used in Mule application to connect to

Twitter

A sample screen is shown in the next slide

Page 7: Integrating with Twitter using Mule ESB Twitter Connector
Page 8: Integrating with Twitter using Mule ESB Twitter Connector

Configuring Twitter Connector

Create a new Mule Application

Click on Global Elements tab in your main flow

Click on Create Button

Select Twitter under Connector Configuration group

Add your Consumer Key, Consumer Secret, Access Token and Access

Token Secret in the corresponding text boxes

In my example, I am reading the keys from a property file and the

property file is loaded using PropertyPlaceholder global component

You can click on Test Connection button to verify connection to

twitter before developing the main flow

A screen shot and sample XML configuration for Twitter connector is

shown in the next slide

Page 9: Integrating with Twitter using Mule ESB Twitter Connector
Page 10: Integrating with Twitter using Mule ESB Twitter Connector

Mule Flow to connect to Twitter and

retrieve user details Configure a flow as shown in the below

Page 11: Integrating with Twitter using Mule ESB Twitter Connector

Deploy your Mule application

Hit the following URL on the browser

http://localhost:3333/twitterconnect

If your authentication details are correct, it show a JSON

message back on your browser with logged in user account

details

Testing and Observation

Page 12: Integrating with Twitter using Mule ESB Twitter Connector