Integrating with Twitter using Mule ESB Twitter Connector
-
Upload
rupeshkrsinha -
Category
Technology
-
view
176 -
download
2
Transcript of Integrating with Twitter using Mule ESB Twitter Connector
Integration with Twitter using
Mule ESB Twitter Connector
Prepared By: Rupesh Sinha
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
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
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
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
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
A sample screen is shown in the next slide
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
Mule Flow to connect to Twitter and
retrieve user details Configure a flow as shown in the below
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