[CONF] Apache Camel Twitter
willem jiang edited the page: Twitter ... Code Block xml dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format Code Block language text twitter://endpoint[?options] ... The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint.
[CONF] Apache Camel Twitter
willem jiang edited the page: Twitter ... Maven users will need to add the following dependency to their pom.xml for this component: Code Block xml dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format Code Block twitter://endpoint[?options] ... Wiki Markup {div:class=confluenceTableSmall} || Name || Default Value || Description || | type | {{direct}} | direct, event, or polling | | delay | {{60}} | in seconds | | consumerKey | {{null}} | Consumer Key. Can also be configured on the {{TwitterComponent}} level instead. | | consumerSecret | {{null}} | Consumer Secret. Can also be configured on the {{TwitterComponent}} level instead. | | accessToken | {{null}} | Access Token. Can also be configured on the {{TwitterComponent}} level instead. | | accessTokenSecret | {{null}} | Access Token
[CONF] Apache Camel Twitter Websocket Blueprint Example
Twitter Websocket Blueprint Example Page edited by Babak Vahdat Changes (1) ... First you need to install the following features in Karaf/ServiceMix with: {code} features:install camel-blueprint features:install camel-twitter features:install camel-websocket ... Full Content Twitter Websocket Blueprint Example Available as of Camel 2.12 This example is located in the Camel distribution at examples/camel-example-twitter-websocket-blueprint. The example is demonstrating how to poll a constant feed of twitter searches and publish results in real time using web socket to a web page. This example is already configured using a testing purpose twitter account named 'cameltweet'. And therefore the example is ready to run out of the box. This account is only for testing purpose, and should not be used in your custom applications. For that you need to setup and use your own twitter account. See more details at Twitter Websocket Example about how to configure twitter to use your own account. Running this example This example requires running in Apache Karaf / ServiceMix You will need to install this example first to your local maven repository with: mvn install To install Apache Camel in Karaf you type in the shell (we use version 2.12.0): features:chooseurl camel 2.12.0 features:install camel First you need to install the following features in Karaf/ServiceMix with: features:install camel-blueprint features:install camel-twitter features:install camel-websocket Then you can install the Camel example: osgi:install -s mvn:org.apache.camel/camel-example-twitter-websocket-blueprint/2.12.0 Then open a browser to see live twitter updates in the web page http://localhost:9090 When the application runs, the webpage should automatic update with new tweets. Blueprint XML file The 'meat' of this example is defined in the OSGi Blueprint XML file in the src/main/resources/OSGI-INF/blueprint/camel-twitter.xml file, which would be a good idea to take a look at, to better understand this example. See also Twitter Websocket Example Twitter Websocket Examples Tutorials User Guide Stop watching space | Change email notification preferences View Online | View Changes
[CONF] Apache Camel Twitter Websocket Blueprint Example
Twitter Websocket Blueprint Example Page edited by Babak Vahdat Changes (3) ... {code} To install Apache Camel in Karaf you type in the shell (we use version 2.12.0): To install Apache Camel in Karaf you type in the shell (as an example here we make use of Camel version 2.12.0): {code} features:chooseurl camel 2.12.0 features:install camel {code} ... Full Content Twitter Websocket Blueprint Example Available as of Camel 2.12 This example is located in the Camel distribution at examples/camel-example-twitter-websocket-blueprint. The example is demonstrating how to poll a constant feed of twitter searches and publish results in real time using web socket to a web page. This example is already configured using a testing purpose twitter account named 'cameltweet'. And therefore the example is ready to run out of the box. This account is only for testing purpose, and should not be used in your custom applications. For that you need to setup and use your own twitter account. See more details at Twitter Websocket Example about how to configure twitter to use your own account. Running this example This example requires running in Apache Karaf / ServiceMix You will need to install this example first to your local maven repository with: mvn install To install Apache Camel in Karaf you type in the shell (as an example here we make use of Camel version 2.12.0): features:chooseurl camel 2.12.0 First you need to install the following features in Karaf/ServiceMix with: features:install camel-blueprint features:install camel-twitter features:install camel-websocket Then you can install the Camel example: osgi:install -s mvn:org.apache.camel/camel-example-twitter-websocket-blueprint/2.12.0 Then open a browser to see live twitter updates in the web page http://localhost:9090 When the application runs, the webpage should automatic update with new tweets. Blueprint XML file The 'meat' of this example is defined in the OSGi Blueprint XML file in the src/main/resources/OSGI-INF/blueprint/camel-twitter.xml file, which would be a good idea to take a look at, to better understand this example. See also Twitter Websocket Example Twitter Websocket Examples Tutorials User Guide Stop watching space | Change email notification preferences View Online | View Changes
[CONF] Apache Camel Twitter
Twitter Page edited by Robert Liguori Changes (1) ... {code} twitter://[endpoint]?[options] twitter://endpoint?[options] {code} ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://endpoint?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status). Endpoint Context Body Type Notice directmessage direct, polling twitter4j.DirectMessage search direct, polling twitter4j.Tweet streaming/filter event, polling twitter4j.Status streaming/sample event, polling twitter4j.Status timeline/home direct, polling twitter4j.Status timeline/mentions direct, polling twitter4j.Status timeline/public direct, polling twitter4j.Status @deprecated. Use timeline/home or direct/home instead. Removed from Camel 2.11 onwards. timeline/retweetsofme direct, polling twitter4j.Status timeline/user direct, polling twitter4j.Status trends/daily Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. trends/weekly Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter keywords null 'foo1,foo2,foo3...' Can be used for search and streaming/filter. See Advanced search for keywords syntax for searching with for example OR. userIds null 'username,username...' Can be used for streaming/filter filterOld true Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. Since Camel 2.11.0 The search producer supports this option sinceId 1 Camel 2.11.0: The last tweet id which will be used for pulling the tweets. It is useful when the camel route is restarted after a long running. lang null Camel 2.11.0: The lang string ISO_639-1 which will be used for searching count null Camel 2.11.0: Limiting number of results per page. numberOfPages 1 Camel 2.11.0: The number of pages result which you want camel-twitter to consume. Message header Name Description CamelTwitterKeywords This header is used by the search producer to change the search key words dynamically. CamelTwitterSearchLanguage Camel 2.11.0: This header can override the option of lang which set the search language for the search endpoint dynamically
[CONF] Apache Camel Twitter
Twitter Page edited by Robert Liguori Changes (1) ... {code} twitter://endpoint?[options] twitter://endpoint[?options] {code} ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://endpoint[?options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status). Endpoint Context Body Type Notice directmessage direct, polling twitter4j.DirectMessage search direct, polling twitter4j.Tweet streaming/filter event, polling twitter4j.Status streaming/sample event, polling twitter4j.Status timeline/home direct, polling twitter4j.Status timeline/mentions direct, polling twitter4j.Status timeline/public direct, polling twitter4j.Status @deprecated. Use timeline/home or direct/home instead. Removed from Camel 2.11 onwards. timeline/retweetsofme direct, polling twitter4j.Status timeline/user direct, polling twitter4j.Status trends/daily Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. trends/weekly Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter keywords null 'foo1,foo2,foo3...' Can be used for search and streaming/filter. See Advanced search for keywords syntax for searching with for example OR. userIds null 'username,username...' Can be used for streaming/filter filterOld true Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. Since Camel 2.11.0 The search producer supports this option sinceId 1 Camel 2.11.0: The last tweet id which will be used for pulling the tweets. It is useful when the camel route is restarted after a long running. lang null Camel 2.11.0: The lang string ISO_639-1 which will be used for searching count null Camel 2.11.0: Limiting number of results per page. numberOfPages 1 Camel 2.11.0: The number of pages result which you want camel-twitter to consume. Message header Name Description CamelTwitterKeywords This header is used by the search producer to change the search key words dynamically. CamelTwitterSearchLanguage Camel 2.11.0: This header can override the option of lang which set the search language for the search endpoint dynamically
[CONF] Apache Camel Twitter Websocket Blueprint Example
Twitter Websocket Blueprint Example File attached by Claus Ibsen gaga.png (110 kB image/png) Stop watching space | Change email notification preferences View Attachments
[CONF] Apache Camel Twitter Websocket Blueprint Example
Twitter Websocket Blueprint Example Page added by Claus Ibsen Twitter Websocket Blueprint Example Available as of Camel 2.12 This example is located in the Camel distribution at examples/camel-example-twitter-websocket-blueprint. The example is demonstrating how to poll a constant feed of twitter searches and publish results in real time using web socket to a web page. This example is already configured using a testing purpose twitter account named 'cameltweet'. And therefore the example is ready to run out of the box. This account is only for testing purpose, and should not be used in your custom applications. For that you need to setup and use your own twitter account. See more details at Twitter Websocket Example about how to configure twitter to use your own account. Running this example This example requires running in Apache Karaf / ServiceMix You will need to install this example first to your local maven repository with: mvn install To install Apache Camel in Karaf you type in the shell (we use version 2.12.0): features:chooseurl camel 2.12.0 features:install camel First you need to install the following features in Karaf/ServiceMix with: features:install camel-twitter features:install camel-websocket Then you can install the Camel example: osgi:install -s mvn:org.apache.camel/camel-example-twitter-websocket-blueprint/2.12.0 Then open a browser to see live twitter updates in the web page http://localhost:9090 When the application runs, the webpage should automatic update with new tweets. Blueprint XML file The 'meat' of this example is defined in the OSGi Blueprint XML file in the src/main/resources/OSGI-INF/blueprint/camel-twitter.xml file, which would be a good idea to take a look at, to better understand this example. See also Twitter Websocket Example Twitter Websocket Examples Tutorials User Guide Stop watching space | Change email notification preferences View Online | Add Comment
[CONF] Apache Camel Twitter Websocket Example
Twitter Websocket Example Page edited by Claus Ibsen Changes (2) ... This example is located in the Camel [distribution|Download] at {{examples/camel-example-twitter-websocket}}. {tip} There is a [Twitter Websocket Blueprint Example] for OSGi Blueprint users. {tip} The example is demonstrating how to poll a constant feed of twitter searches and publish results in real time using web socket to a web page. As usual the code in Camel is very simple. All it takes is roughly ... h3. See also - [Twitter Websocket Blueprint Example] - [Twitter] - [Websocket] ... Full Content Twitter Websocket Example Available as of Camel 2.10 This example is located in the Camel distribution at examples/camel-example-twitter-websocket. There is a Twitter Websocket Blueprint Example for OSGi Blueprint users. The example is demonstrating how to poll a constant feed of twitter searches and publish results in real time using web socket to a web page. As usual the code in Camel is very simple. All it takes is roughly from("twitter://search?...") .to("websocket:camel-tweet?sendToAll=true") This example is already configured using a testing purpose twitter account named 'cameltweet'. And therefore the example is ready to run out of the box. This account is only for testing purpose, and should not be used in your custom applications. For that you need to setup and use your own twitter account. How to use my own twitter accountTo use twitter, you need a twitter account which have setup an application to be used. For twitter users, you may be familiar that twitter requires you to grant applications access to your twitter account, such as twitter for iphone etc. The same applies for this example. You can read details about how to setup a new twitter application at the Camel Twitter documentation. In your Twitter settings under the Apps menu, it will list your approved applications. For example I created an application named "Camel-Example" which is now listed as approved with read-only access. When you have created an application, you get a number of details back from twitter which you need to use the twitter component. Enter these details in the source code at: src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java You will need to compile this example first: mvn compile To run the example type mvn exec:java Then open a browser to see live twitter updates in the webpage http://localhost:9090/index.html To stop the example hit ctrl + c When the application runs, the webpage should automatic update with new tweets. A screenshot below illustrates what you would see: See also Twitter Websocket Blueprint Example Twitter Websocket Examples Tutorials User Guide Stop watching space | Change email notification preferences View Online | View Changes | Add Comment
[CONF] Apache Camel Twitter
Twitter Page edited by Claus Ibsen Changes (2) ... | user | {{null}} | Username, used for user timeline consumption, direct message production, etc. | | locations| {{null}} | lat,lon;lat,lon;... Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter | | keywords| {{null}} | foo1,foo2,foo3... Can be used for search and streaming/filter | | keywords| {{null}} | foo1,foo2,foo3... Can be used for search and streaming/filter. See [Advanced search|https://support.twitter.com/articles/71577-using-advanced-search] for keywords syntax for searching with for example OR. | | userIds| {{null}} | username,username... Can be used for streaming/filter | | filterOld | {{true}} | Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. *Since Camel 2.11.0* The search producer supports this option | ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status). Endpoint Context Body Type Notice directmessage direct, polling twitter4j.DirectMessage search direct, polling twitter4j.Tweet streaming/filter event, polling twitter4j.Status streaming/sample event, polling twitter4j.Status timeline/home direct, polling twitter4j.Status timeline/mentions direct, polling twitter4j.Status timeline/public direct, polling twitter4j.Status @deprecated. Use timeline/home or direct/home instead. Removed from Camel 2.11 onwards. timeline/retweetsofme direct, polling twitter4j.Status timeline/user direct, polling twitter4j.Status trends/daily Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. trends/weekly Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter keywords null 'foo1,foo2,foo3...' Can be used for search and streaming/filter. See Advanced search for keywords syntax for searching with for example OR. userIds null 'username,username...' Can be used for streaming/filter filterOld true Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. Since Camel 2.11.0 The search producer
[CONF] Apache Camel Twitter
Twitter Page edited by willem jiang Comment: CAMEL-6021, CAMEL-6022 Changes (3) ... | sinceId | {{1}} | *Camel 2.11.0:* The last tweet id which will be used for pulling the tweets. It is useful when the camel route is restarted after a long running.| | lang | {{null}} | *Camel 2.11.0:* The lang string [ISO_639-1|http://en.wikipedia.org/wiki/ISO_639-1] which will be used for searching | | count | {{null}} | *Camel 2.11.0:* Limiting number of results per page. | | numberOfPages | {{1}} | *Camel 2.11.0:* The number of pages result which you want camel-twitter to consume. | {div} ... || Name || Description || |{{CamelTwitterKeywords}}|This header is used by the search producer to change the search key words dynamically.| |{{TWITTER_SEARCH_LANGUAGE}}| |{{CamelTwitterSearchLanguage}}| *Camel 2.11.0:* This header can override the option of {{lang}} which set the search language for the search endpoint dynamically| |{{CamelTwitterCount}}|*Camel 2.11.0* This header can override the option of {{count}} which sets the max twitters that will be returned.| |{{CamelTwitterNumberOfPages}}|*Camel 2.11.0* This header can converrid the option of {{numberOfPages}} which sets how many pages we want to twitter returns.| {div} ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status). Endpoint Context Body Type Notice directmessage direct, polling twitter4j.DirectMessage search direct, polling twitter4j.Tweet streaming/filter event, polling twitter4j.Status streaming/sample event, polling twitter4j.Status timeline/home direct, polling twitter4j.Status timeline/mentions direct, polling twitter4j.Status timeline/public direct, polling twitter4j.Status @deprecated. Use timeline/home or direct/home instead. Removed from Camel 2.11 onwards. timeline/retweetsofme direct, polling twitter4j.Status timeline/user direct, polling twitter4j.Status trends/daily Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. trends/weekly Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for
[CONF] Apache Camel Twitter
Twitter Page edited by willem jiang Comment: CAMEL-5984 Changes (4) ... | keywords| {{null}} | foo1,foo2,foo3... Can be used for search and streaming/filter | | userIds| {{null}} | username,username... Can be used for streaming/filter | | filterOld | {{true}} | Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. *Since Camel 2.11.0* The search producer supports this option | | sinceId | {{1}} | *Camel 2.11.0:* The last tweet id which will be used for pulling the tweets. It is useful when the camel route is restarted after a long running.| | lang | {{null}} | *Camel 2.11.0:* The lang string [ISO_639-1|http://en.wikipedia.org/wiki/ISO_639-1] which will be used for searching | {div} h3. Message header {div:class=confluenceTableSmall} || Name || Description || |{{CamelTwitterKeywords}}|This header is used by the search producer to change the search key words dynamically.| |{{TWITTER_SEARCH_LANGUAGE}}| *Camel 2.11.0:* This header can override the option of {{lang}} which set the search language for the search endpoint dynamically| {div} h3. Message body ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status). Endpoint Context Body Type Notice directmessage direct, polling twitter4j.DirectMessage search direct, polling twitter4j.Tweet streaming/filter event, polling twitter4j.Status streaming/sample event, polling twitter4j.Status timeline/home direct, polling twitter4j.Status timeline/mentions direct, polling twitter4j.Status timeline/public direct, polling twitter4j.Status @deprecated. Use timeline/home or direct/home instead. Removed from Camel 2.11 onwards. timeline/retweetsofme direct, polling twitter4j.Status timeline/user direct, polling twitter4j.Status trends/daily Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. trends/weekly Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter keywords null 'foo1,foo2,foo3...' Can be used for search and streaming/filter userIds
[CONF] Apache Camel Twitter
Twitter Page edited by willem jiang Changes (1) ... | userIds| {{null}} | username,username... Can be used for streaming/filter | | filterOld | {{true}} | Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. | | sinceId | {{1}} | *Camel 2.11.0:* The last tweet id which will be used for pulling the tweets. It is useful when the camel route is restarted.| {div} ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status). Endpoint Context Body Type Notice directmessage direct, polling twitter4j.DirectMessage search direct, polling twitter4j.Tweet streaming/filter event, polling twitter4j.Status streaming/sample event, polling twitter4j.Status timeline/home direct, polling twitter4j.Status timeline/mentions direct, polling twitter4j.Status timeline/public direct, polling twitter4j.Status @deprecated. Use timeline/home or direct/home instead. Removed from Camel 2.11 onwards. timeline/retweetsofme direct, polling twitter4j.Status timeline/user direct, polling twitter4j.Status trends/daily Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. trends/weekly Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter keywords null 'foo1,foo2,foo3...' Can be used for search and streaming/filter userIds null 'username,username...' Can be used for streaming/filter filterOld true Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. sinceId 1 Camel 2.11.0: The last tweet id which will be used for pulling the tweets. It is useful when the camel route is restarted. Message body All message bodies utilize objects provided by the Twitter4J API. Use cases 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:
[CONF] Apache Camel Twitter
Twitter Page edited by Claus Ibsen Changes (12) ... Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if timeline/home results in five statuses, the route will be executed five times (one for each Status). {div:class=confluenceTableSmall} || Endpoint || Context || Body Type || Notice || | streaming/filter | event, polling | twitter4j.Status | | | directmessage | direct, polling | twitter4j.DirectMessage | | | search | direct, polling | twitter4j.Tweet | | | streaming/filter streaming/sample | event, polling | twitter4j.Status | | | streaming/sample | event, polling | twitter4j.Status | | timeline/home | direct, polling | twitter4j.Status | | | timeline/home timeline/mentions | direct, polling | twitter4j.Status | | | timeline/public | direct, polling | twitter4j.Status | @deprecated. Use timeline/home or direct/home instead. Removed from *Camel 2.11* onwards. | | timeline/mentions timeline/retweetsofme | direct, polling | twitter4j.Status | | | timeline/public timeline/user | direct, polling | twitter4j.Status | | | timeline/retweetsofme | direct, polling | twitter4j.Status | | timeline/user | direct, polling | twitter4j.Status | | trends/daily | *Camel 2.10.1:* direct, polling | twitter4j.Status | @deprecated. Removed from Camel 2.11 onwards. | | trends/weekly | *Camel 2.10.1:* direct, polling | twitter4j.Status | @deprecated. Removed from Camel 2.11 onwards. | {div} ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status). Endpoint Context Body Type Notice directmessage direct, polling twitter4j.DirectMessage search direct, polling twitter4j.Tweet streaming/filter event, polling twitter4j.Status streaming/sample event, polling twitter4j.Status timeline/home direct, polling twitter4j.Status timeline/mentions direct, polling twitter4j.Status timeline/public direct, polling twitter4j.Status @deprecated. Use timeline/home or direct/home instead. Removed from Camel 2.11 onwards. timeline/retweetsofme direct, polling twitter4j.Status timeline/user direct, polling twitter4j.Status trends/daily Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. trends/weekly Camel 2.10.1: direct, polling twitter4j.Status @deprecated. Removed from Camel 2.11 onwards. Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level
[CONF] Apache Camel Twitter
Twitter Page edited by Claus Ibsen Changes (1) ... | timeline/retweetsofme | direct, polling | twitter4j.Status | | timeline/user | direct, polling | twitter4j.Status | | trends/daily | *Camel 2.10.1:* direct, polling | twitter4j.Status | | trends/weekly | *Camel 2.10.1:* direct, polling | twitter4j.Status | {div} ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status). Endpoint Context Body Type directmessage direct, polling twitter4j.DirectMessage search direct, polling twitter4j.Tweet streaming/filter event, polling twitter4j.Status streaming/sample event, polling twitter4j.Status timeline/home direct, polling twitter4j.Status timeline/mentions direct, polling twitter4j.Status timeline/public direct, polling twitter4j.Status timeline/retweetsofme direct, polling twitter4j.Status timeline/user direct, polling twitter4j.Status trends/daily Camel 2.10.1: direct, polling twitter4j.Status trends/weekly Camel 2.10.1: direct, polling twitter4j.Status Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter keywords null 'foo1,foo2,foo3...' Can be used for search and streaming/filter userIds null 'username,username...' Can be used for streaming/filter filterOld true Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. Message body All message bodies utilize objects provided by the Twitter4J API. Use cases 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=pollingdelay=5consumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]") .to("bean:blah"); To search for all statuses with the keyword 'camel': from("twitter://search?type=directkeywords=camelconsumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]") .to("bean:blah"); Searching using a producer with static keywords from("direct:foo") .to("twitter://search?keywords=camelconsumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]");
[CONF] Apache Camel Twitter
Twitter Page edited by Brett E. Meyer Changes (11) ... h3. Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if timeline/home results in five statuses, the route will be executed five times (one for each Status). {div:class=confluenceTableSmall} || Endpoint || Context || Body Type || | directmessage | direct, polling | Listtwitter4j.DirectMessage twitter4j.DirectMessage | | search | direct, polling | Listtwitter4j.Tweet twitter4j.Tweet | | streaming/filter | event, polling | Listtwitter4j.Status twitter4j.Status | | streaming/sample | event, polling | event: twitter4j.Status, polling: Listtwitter4j.Status | | streaming/sample | event, polling | twitter4j.Status | | timeline/home | direct, polling | Listtwitter4j.Status twitter4j.Status | | timeline/mentions | direct, polling | Listtwitter4j.Status twitter4j.Status | | timeline/public | direct, polling | Listtwitter4j.Status twitter4j.Status | | timeline/retweetsofme | direct, polling | Listtwitter4j.Status twitter4j.Status | | timeline/user | direct, polling | Listtwitter4j.Status twitter4j.Status | {div} ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status). Endpoint Context Body Type directmessage direct, polling twitter4j.DirectMessage search direct, polling twitter4j.Tweet streaming/filter event, polling twitter4j.Status streaming/sample event, polling twitter4j.Status timeline/home direct, polling twitter4j.Status timeline/mentions direct, polling twitter4j.Status timeline/public direct, polling twitter4j.Status timeline/retweetsofme direct, polling twitter4j.Status timeline/user direct, polling twitter4j.Status Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter keywords null 'foo1,foo2,foo3...' Can be used for search and streaming/filter userIds null 'username,username...' Can be used for streaming/filter filterOld true Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id.
[CONF] Apache Camel Twitter
Twitter Page edited by Brett E. Meyer Changes (2) ... | accessTokenSecret | {{null}} | Access Token Secret. Can also be configured on the {{TwitterComponent}} level instead. | | user | {{null}} | Username, used for user timeline consumption, direct message production, etc. | | locations| {{null}} | lat,lon,lat,lon,... Can be used for streaming/filter | | keywords| {{null}} | lat,lon;lat,lon;... foo1,foo2,foo3... Can be used for search and streaming/filter | | userIds| {{null}} | username,username... Can be used for streaming/filter | | filterOld | {{true}} | Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. | ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Endpoint Context Body Type directmessage direct, polling Listtwitter4j.DirectMessage search direct, polling Listtwitter4j.Tweet streaming/filter event, polling Listtwitter4j.Status streaming/sample event, polling event: twitter4j.Status, polling: Listtwitter4j.Status timeline/home direct, polling Listtwitter4j.Status timeline/mentions direct, polling Listtwitter4j.Status timeline/public direct, polling Listtwitter4j.Status timeline/retweetsofme direct, polling Listtwitter4j.Status timeline/user direct, polling Listtwitter4j.Status Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon,lat,lon,...' Can be used for streaming/filter keywords null 'foo1,foo2,foo3...' Can be used for search and streaming/filter userIds null 'username,username...' Can be used for streaming/filter filterOld true Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. Message body All message bodies utilize objects provided by the Twitter4J API. Use cases 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=pollingdelay=5consumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]") .to("bean:blah"); To search for all statuses with the keyword 'camel': from("twitter://search?type=directkeywords=camelconsumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]") .to("bean:blah"); Searching using a producer with static keywords from("direct:foo")
[CONF] Apache Camel Twitter
Twitter Page edited by Brett E. Meyer Changes (2) ... | accessTokenSecret | {{null}} | Access Token Secret. Can also be configured on the {{TwitterComponent}} level instead. | | user | {{null}} | Username, used for user timeline consumption, direct message production, etc. | | locations| {{null}} | lat,lon,lat,lon,... Can be used for streaming/filter | | locations| {{null}} | lat,lon;lat,lon;... Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter | | keywords| {{null}} | foo1,foo2,foo3... Can be used for search and streaming/filter | | userIds| {{null}} | username,username... Can be used for streaming/filter | ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Endpoint Context Body Type directmessage direct, polling Listtwitter4j.DirectMessage search direct, polling Listtwitter4j.Tweet streaming/filter event, polling Listtwitter4j.Status streaming/sample event, polling event: twitter4j.Status, polling: Listtwitter4j.Status timeline/home direct, polling Listtwitter4j.Status timeline/mentions direct, polling Listtwitter4j.Status timeline/public direct, polling Listtwitter4j.Status timeline/retweetsofme direct, polling Listtwitter4j.Status timeline/user direct, polling Listtwitter4j.Status Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. locations null 'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filter keywords null 'foo1,foo2,foo3...' Can be used for search and streaming/filter userIds null 'username,username...' Can be used for streaming/filter filterOld true Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. Message body All message bodies utilize objects provided by the Twitter4J API. Use cases 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=pollingdelay=5consumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]") .to("bean:blah"); To search for all statuses with the keyword 'camel': from("twitter://search?type=directkeywords=camelconsumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]") .to("bean:blah"); Searching using a producer with static keywords from("direct:foo")
[CONF] Apache Camel Twitter
Twitter Page edited by Claus Ibsen Changes (11) ... || Endpoint || Body Type || | directmessage | String | | search | Listtwitter4j.Tweet | | timeline/user | String | {div} h3. URI Options {div:class=confluenceTableSmall} || Name || Default Value || Description || | type | {{direct}} | direct, event, or polling | | delay | {{60}} | in seconds | | consumerKey | {{null}} | Consumer Key. Can also be configured on the {{TwitterComponent}} level instead. | | consumerSecret | {{null}} | Consumer Secret. Can also be configured on the {{TwitterComponent}} level instead. | ... | keywords| {{null}} | lat,lon;lat,lon;... Can be used for streaming/filter | | userIds| {{null}} | username,username... Can be used for streaming/filter | | filterOld | {{true}} | Filter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. | {div} ... h4. To create a status update within your Twitter profile, send this producer a String body. {code} from(direct:foo) twitter://timeline/user?consumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s] .to(twitter://timeline/user?consumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]); {code} h4. To poll, every 5 sec., all statuses on your home timeline: {code} from(twitter://timeline/home?type=pollingdelay=5consumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]) .to(bean:blah); {code} h4. To search for all statuses with the keyword camel: {code} from(twitter://search?type=directkeywords=camelconsumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]) .to(bean:blah); {code} h4. Searching using a producer with static keywords {code} from(direct:foo) .to(twitter://search?keywords=camelconsumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]); {code} h4. 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. {code} from(direct:foo) .setHeader(CamelTwitterKeywords, header(bar)) .to(twitter://search?consumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s]); {code} h3. Example See also the [Twitter Websocket Example]. ... Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId version${camel-version}/version /dependency URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Endpoint Context Body Type directmessage direct, polling Listtwitter4j.DirectMessage search direct, polling Listtwitter4j.Tweet streaming/filter event, polling Listtwitter4j.Status streaming/sample event, polling event: twitter4j.Status, polling: Listtwitter4j.Status timeline/home direct, polling Listtwitter4j.Status timeline/mentions direct, polling Listtwitter4j.Status timeline/public direct, polling Listtwitter4j.Status timeline/retweetsofme direct, polling Listtwitter4j.Status timeline/user direct, polling Listtwitter4j.Status Producer Endpoints: Endpoint Body Type directmessage String search Listtwitter4j.Tweet timeline/user String URI Options Name Default Value Description type direct direct, event, or polling
[CONF] Apache Camel Twitter Websocket Example
Twitter Websocket Example Page edited by Claus Ibsen Changes (3) ... {code} This example is already configured using a testing purpose twitter account named cameltweet. And therefore the example is ready to run out of the box. This account is only for testing purpose, and should *not* be used in your custom applications. For that you need to setup and use your own twitter account. {info:title=How to use my own twitter account} To use twitter, you need a twitter account which have setup an application to be used. For twitter users, you may be familiar that twitter requires you to grant applications access to your twitter account, such as twitter for iphone etc. ... which you need to use the twitter component. Enter these details in the source code at: {{src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java}} in the constant fileds, by replacing the values INSERT HERE. {info} You will need to compile this example first: ... Full Content Twitter Websocket Example Available as of Camel 2.10 This example is located in the Camel distribution at examples/camel-example-twitter-websocket. The example is demonstrating how to poll a constant feed of twitter searches and publish results in real time using web socket to a web page. As usual the code in Camel is very simple. All it takes is roughly from("twitter://search?...") .setHeader("websocket.sendToAll", "true") .to("websocket:camel-tweet") This example is already configured using a testing purpose twitter account named 'cameltweet'. And therefore the example is ready to run out of the box. This account is only for testing purpose, and should not be used in your custom applications. For that you need to setup and use your own twitter account. How to use my own twitter accountTo use twitter, you need a twitter account which have setup an application to be used. For twitter users, you may be familiar that twitter requires you to grant applications access to your twitter account, such as twitter for iphone etc. The same applies for this example. You can read details about how to setup a new twitter application at the Camel Twitter documentation. In your Twitter settings under the Apps menu, it will list your approved applications. For example I created an application named "Camel-Example" which is now listed as approved with read-only access. When you have created an application, you get a number of details back from twitter which you need to use the twitter component. Enter these details in the source code at: src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java You will need to compile this example first: mvn compile To run the example type mvn exec:java Then open a browser to see live twitter updates in the webpage http://localhost:9090 To stop the example hit ctrl + c When the application runs, the webpage should automatic update with new tweets. A screenshot below illustrates what you would see: See also Twitter Websocket Examples Tutorials User Guide Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel Twitter
Twitter Page edited by Claus Ibsen Changes (6) ... {code} h3. TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. {div:class=confluenceTableSmall} || Option || Description || | consumerKey | The consumer key | | consumerSecret | The consumer secret | | accessToken | The access token | | accessTokenSecret | The access token secret | {div} h3. Consumer Endpoints: {div:class=confluenceTableSmall} ... | type | direct | direct, event, or polling | | delay | 60 | in seconds | | *consumerKey | {{null}} | Consumer Key | | *consumerSecret | {{null}} | Consumer Secret | | *accessToken | {{null}} | Access Token | | *accessTokenSecret | {{null}} | Access Token Secret | | consumerKey | {{null}} | Consumer Key. Can also be configured on the {{TwitterComponent}} level instead. | | consumerSecret | {{null}} | Consumer Secret. Can also be configured on the {{TwitterComponent}} level instead. | | accessToken | {{null}} | Access Token. Can also be configured on the {{TwitterComponent}} level instead. | | accessTokenSecret | {{null}} | Access Token Secret. Can also be configured on the {{TwitterComponent}} level instead. | | user | {{null}} | Username, used for user timeline consumption, direct message production, etc. | | keywords| {{null}} | lat,lon;lat,lon;... Can be used for streaming/filter | | userIds| {{null}} | username,username... Can be used for streaming/filter | {info:title=Note} Options: (* = required). {info} h3. Message body ... twitter://search?type=directkeywords=camelconsumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s] {code} h3. Example See also the [Twitter Websocket Example]. {include:Endpoint See Also} - [Twitter Websocket Example] Full Content Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. URI format twitter://[endpoint]?[options] TwitterComponent: The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint. Option Description consumerKey The consumer key consumerSecret The consumer secret accessToken The access token accessTokenSecret The access token secret Consumer Endpoints: Endpoint Context Body Type directmessage direct, polling Listtwitter4j.DirectMessage search direct, polling Listtwitter4j.Tweet streaming/filter event, polling Listtwitter4j.Status streaming/sample event, polling event: twitter4j.Status, polling: Listtwitter4j.Status timeline/home direct, polling Listtwitter4j.Status timeline/mentions direct, polling Listtwitter4j.Status timeline/public direct, polling Listtwitter4j.Status timeline/retweetsofme direct, polling Listtwitter4j.Status timeline/user direct, polling Listtwitter4j.Status Producer Endpoints: Endpoint Body Type directmessage String timeline/user String URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds consumerKey null Consumer Key. Can also be configured on the TwitterComponent level instead. consumerSecret null Consumer Secret. Can also be configured on the TwitterComponent level instead. accessToken null Access Token. Can also be configured on the TwitterComponent level instead. accessTokenSecret null Access Token Secret. Can also be configured on the TwitterComponent level instead. user null Username, used for user timeline consumption, direct message production, etc. keywords null 'lat,lon;lat,lon;...' Can be used for streaming/filter userIds null 'username,username...' Can be used for streaming/filter Message body All message bodies utilize objects provided by the Twitter4J API. Maven Dependency:
[CONF] Apache Camel Twitter Websocket Example
Twitter Websocket Example Page added by Claus Ibsen Twitter Websocket Example Available as of Camel 2.10 This example is located in the Camel distribution at examples/camel-example-twitter-websocket. The example is demonstrating how to poll a constant feed of twitter searches and publish results in real time using web socket to a web page. As usual the code in Camel is very simple. All it takes is roughly from("twitter://search?...") .setHeader("websocket.sendToAll", "true") .to("websocket:camel-tweet") To use twitter, you need a twitter account which have setup an application to be used. For twitter users, you may be familiar that twitter requires you to grant applications access to your twitter account, such as twitter for iphone etc. The same applies for this example. You can read details about how to setup a new twitter application at the Camel Twitter documentation. In your Twitter settings under the Apps menu, it will list your approved applications. For example I created an application named "Camel-Example" which is now listed as approved with read-only access. Unable to render embedded object: File (twitter-apps.png) not found. When you have created an application, you get a number of details back from twitter which you need to use the twitter component. Enter these details in the source code at: src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java in the constant fileds, by replacing the values "INSERT HERE". You will need to compile this example first: mvn compile To run the example type mvn exec:java Then open a browser to see live twitter updates in the webpage http://localhost:9090 To stop the example hit ctrl + c When the application runs, the webpage should automatic update with new tweets. A screenshot below illustrates what you would see: Unable to render embedded object: File (gaga.png) not found. Change Notification Preferences View Online | Add Comment
[CONF] Apache Camel Twitter Websocket Example
Twitter Websocket Example File attached by Claus Ibsen twitter-apps.png (18 kB image/png) Change Notification Preferences View Attachments
[CONF] Apache Camel Twitter Websocket Example
Twitter Websocket Example File attached by Claus Ibsen gaga.png (110 kB image/png) Change Notification Preferences View Attachments
[CONF] Apache Camel Twitter Websocket Example
Twitter Websocket Example Page edited by Claus Ibsen Changes (1) ... When the application runs, the webpage should automatic update with new tweets. A screenshot below illustrates what you would see: !gaga.png! h3. See also - [Twitter] - [Websocket] - [Examples] - [Tutorials] - [User Guide] Full Content Twitter Websocket Example Available as of Camel 2.10 This example is located in the Camel distribution at examples/camel-example-twitter-websocket. The example is demonstrating how to poll a constant feed of twitter searches and publish results in real time using web socket to a web page. As usual the code in Camel is very simple. All it takes is roughly from("twitter://search?...") .setHeader("websocket.sendToAll", "true") .to("websocket:camel-tweet") To use twitter, you need a twitter account which have setup an application to be used. For twitter users, you may be familiar that twitter requires you to grant applications access to your twitter account, such as twitter for iphone etc. The same applies for this example. You can read details about how to setup a new twitter application at the Camel Twitter documentation. In your Twitter settings under the Apps menu, it will list your approved applications. For example I created an application named "Camel-Example" which is now listed as approved with read-only access. When you have created an application, you get a number of details back from twitter which you need to use the twitter component. Enter these details in the source code at: src/main/java/org/apache/camel/example/websocket/CamelTwitterWebSocketMain.java in the constant fileds, by replacing the values "INSERT HERE". You will need to compile this example first: mvn compile To run the example type mvn exec:java Then open a browser to see live twitter updates in the webpage http://localhost:9090 To stop the example hit ctrl + c When the application runs, the webpage should automatic update with new tweets. A screenshot below illustrates what you would see: See also Twitter Websocket Examples Tutorials User Guide Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel Twitter
Twitter Page added by Bilgin Ibryam Twitter Available as of Camel 2.10 The Twitter component enables the most useful features of the Twitter API by encapsulating Twitter4J. It allows direct, polling, or event-driven consumption of timelines, users, trends, and direct messages. Also, it supports producing messages as status updates or direct messages. Twitter now requires the use of OAuth for all client application authentication. In order to use camel-twitter with your account, you'll need to create a new application within Twitter at https://dev.twitter.com/apps/new and grant the application access to your account. Finally, generate your access token and secret. Since all message bodies rely on Twitter4J objects, the additional Twitter4J dependencies will be necessary within your project. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-twitter/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency dependency groupIdorg.twitter4j/groupId artifactIdtwitter4j-core/artifactId version${twitter4j-version}/version /dependency dependency groupIdorg.twitter4j/groupId artifactIdtwitter4j-stream/artifactId version${twitter4j-version}/version /dependency URI format twitter://[endpoint]?[options] URI Options Name Default Value Description type direct direct, event, or polling delay 60 in seconds *consumerKey null Consumer Key *consumerSecret null Consumer Secret *accessToken null Access Token *accessTokenSecret null Access Token Secret user null Username, used for user timeline consumption, direct message production, etc. keywords null 'lat,lon;lat,lon;...' Can be used for streaming/filter userIds null 'username,username...' Can be used for streaming/filter NotesOptions: (* = required). Message body: All message bodies utilize objects provided by the Twitter4J library. Consumer Endpoints: Endpoint Context Body Type directmessage direct, polling Listtwitter4j.DirectMessage search direct, polling Listtwitter4j.Tweet streaming/filter event, polling Listtwitter4j.Status streaming/sample event, polling event: twitter4j.Status, polling: Listtwitter4j.Status timeline/home direct, polling Listtwitter4j.Status timeline/mentions direct, polling Listtwitter4j.Status timeline/public direct, polling Listtwitter4j.Status timeline/retweetsofme direct, polling Listtwitter4j.Status timeline/user direct, polling Listtwitter4j.Status Producer Endpoints: Endpoint Body Type directmessage String timeline/user String Use cases To create a status update within your Twitter profile, send this producer a String body. twitter://timeline/user?consumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s] To poll, every 5 sec., all statuses on your home timeline: twitter://timeline/home?type=pollingdelay=5consumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s] To search for all statuses with the keyword 'camel': twitter://search?type=directkeywords=camelconsumerKey=[s]consumerSecret=[s]accessToken=[s]accessTokenSecret=[s] See Also Configuring Camel Component Endpoint Getting Started Change Notification Preferences View Online | Add Comment