--
Integrating with Twitter may or may not be a need for a organization.
In this post we will look at how to Tweet from ODI.
Twitter exposes API's to manipulate data.
Twitter also enforced OAuth authentication and recommends all client applications to use it.
How the OAuth works is described here and all the related terminology associated with OAuth can be found here.
If you have a Twitter Account , this is what you need to do..
1) Register a Twitter Application-
Sigin into http://dev.twitter.com/ and choose option 2 - Register an App
Make sure you choose Application Type - "Client" as shown below.
After registering , twitter will generate Consumer Key and Consumer Secret.
2) Registering Twitter Application from ODI -
Current version of Java (1.6) does not have inbuild libraries to support OAuth authentication. Either end users have to write there own java libraries to get around OAuth and integrate with twitter api's or use open source libraries like jTwitter , scribe , twitter4j , etc.
In this post, I will be using twitter4j api's (jar file) which can be downloaded from here.
I have created an ODI open tool (TwitterRegistrationODI) to register any twitter application for any twitter account. This will generate the Access Token and Token Secret required for integrating with twitter API's.
The open tool code can be downloaded from here. You need to compile, add your own icon or any free to use icon and create the JAR files. The code was developed using ODI11g.
Add the jar files to your agent path and client user path.
Add the Open tool to ODI using the menu option "ODI -> ADD/Remove Open Tools .. "
Add the Open tool to a package to execute it.
This open tool requires input - Consumer Key , Consumer Secret and Output token file (Access Token and Token Secret will be written to this file). There are other optional proxy parameters which can be set as per the environment.
Executing the step will pop up a window with URL to authorize the twitter application.
Copy the URL. Use any browser and grant the Twitter application access by logging with your twitter account.
This will generate a PINCODE which is needed to generate Access Token and Token Secret.
Goback to ODI and hit enter and this will popup another window. Enter the PINCODE.
Success Message is displayed , if access token and token secret are generated successfully.
The output file has the Access Token and Token Secret.
Note: This process of generating Access Token and Token Secret is needed only once. If the consumer key and consumer token are reset for a twitter application, then the new access token and token secret needs to regenerated.
3) Tweeting from ODI -
Created another Open tool (TwitterODI). This open tool will be used to tweet from ODI.
The open tool can be downloaded from here. You need to compile, add your own icon or any free to use icon and create the JAR files. The code was developed using ODI11g.
Add the jar file to your agent path and client user path. Import the open tool.
Add it to a package, set the parameters and execute.
Execute the step/package. Signin into Twitter and here we have our message.
This Open tool can be modified further to do other things like getting new tweets , searching tweets , etc..but off course its limited to api's provided by twitter4j.
In my opinion its a complete library.
--
Integrating with Twitter may or may not be a need for a organization.
In this post we will look at how to Tweet from ODI.
Twitter exposes API's to manipulate data.
Twitter also enforced OAuth authentication and recommends all client applications to use it.
How the OAuth works is described here and all the related terminology associated with OAuth can be found here.
If you have a Twitter Account , this is what you need to do..
1) Register a Twitter Application-
Sigin into http://dev.twitter.com/ and choose option 2 - Register an App
Make sure you choose Application Type - "Client" as shown below.
After registering , twitter will generate Consumer Key and Consumer Secret.
2) Registering Twitter Application from ODI -
Current version of Java (1.6) does not have inbuild libraries to support OAuth authentication. Either end users have to write there own java libraries to get around OAuth and integrate with twitter api's or use open source libraries like jTwitter , scribe , twitter4j , etc.
In this post, I will be using twitter4j api's (jar file) which can be downloaded from here.
I have created an ODI open tool (TwitterRegistrationODI) to register any twitter application for any twitter account. This will generate the Access Token and Token Secret required for integrating with twitter API's.
The open tool code can be downloaded from here. You need to compile, add your own icon or any free to use icon and create the JAR files. The code was developed using ODI11g.
Add the jar files to your agent path and client user path.
Add the Open tool to ODI using the menu option "ODI -> ADD/Remove Open Tools .. "
Add the Open tool to a package to execute it.
This open tool requires input - Consumer Key , Consumer Secret and Output token file (Access Token and Token Secret will be written to this file). There are other optional proxy parameters which can be set as per the environment.
Executing the step will pop up a window with URL to authorize the twitter application.
Copy the URL. Use any browser and grant the Twitter application access by logging with your twitter account.
This will generate a PINCODE which is needed to generate Access Token and Token Secret.
Goback to ODI and hit enter and this will popup another window. Enter the PINCODE.
Success Message is displayed , if access token and token secret are generated successfully.
The output file has the Access Token and Token Secret.
Note: This process of generating Access Token and Token Secret is needed only once. If the consumer key and consumer token are reset for a twitter application, then the new access token and token secret needs to regenerated.
3) Tweeting from ODI -
Created another Open tool (TwitterODI). This open tool will be used to tweet from ODI.
The open tool can be downloaded from here. You need to compile, add your own icon or any free to use icon and create the JAR files. The code was developed using ODI11g.
Add the jar file to your agent path and client user path. Import the open tool.
Add it to a package, set the parameters and execute.
Execute the step/package. Signin into Twitter and here we have our message.
This Open tool can be modified further to do other things like getting new tweets , searching tweets , etc..but off course its limited to api's provided by twitter4j.
In my opinion its a complete library.
--