Use cases - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

To create a status update within your Twitter profile, send this producer a String body.

from("direct:foo")
  .to("twitter://timeline/user?consumerKey=[s]&consumerSecret=[s]&accessToken=
[s]&accessTokenSecret=[s]);

To poll, every 5 sec., all statuses on your home timeline:

from("twitter://timeline/home?type=polling&delay=5&consumerKey=[s]&consumerSecret=
[s]&accessToken=[s]&accessTokenSecret=[s]")
  .to("bean:blah");

To search for all statuses with the keyword 'camel':

from("twitter://search?type=direct&keywords=camel&consumerKey=[s]&consumerSecret=
[s]&accessToken=[s]&accessTokenSecret=[s]")
  .to("bean:blah");

Searching using a producer with static keywords

from("direct:foo")
  .to("twitter://search?keywords=camel&consumerKey=[s]&consumerSecret=[s]&accessToken=
[s]&accessTokenSecret=[s]");

Searching using a producer with dynamic keywords from header

In the bar header we have the keywords we want to search, so we can assign this value to the CamelTwitterKeywords header.

from("direct:foo")
  .setHeader("CamelTwitterKeywords", header("bar"))
  .to("twitter://search?consumerKey=[s]&consumerSecret=[s]&accessToken=[s]&access
TokenSecret=[s]");