Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 857BB9094 for ; Mon, 19 Mar 2012 09:19:14 +0000 (UTC) Received: (qmail 42161 invoked by uid 500); 19 Mar 2012 09:19:14 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 42073 invoked by uid 500); 19 Mar 2012 09:19:13 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 42046 invoked by uid 99); 19 Mar 2012 09:19:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Mar 2012 09:19:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Mar 2012 09:19:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9677E23888EA for ; Mon, 19 Mar 2012 09:18:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r809144 - in /websites/production/camel/content: cache/main.pageCache examples.html twitter-websocket-example.data/ twitter-websocket-example.data/gaga.png twitter-websocket-example.data/twitter-apps.png twitter-websocket-example.html Date: Mon, 19 Mar 2012 09:18:43 -0000 To: commits@camel.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120319091843.9677E23888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Mon Mar 19 09:18:42 2012 New Revision: 809144 Log: Production update by buildbot for camel Added: websites/production/camel/content/twitter-websocket-example.data/ websites/production/camel/content/twitter-websocket-example.data/gaga.png (with props) websites/production/camel/content/twitter-websocket-example.data/twitter-apps.png (with props) websites/production/camel/content/twitter-websocket-example.html Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/examples.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/examples.html ============================================================================== --- websites/production/camel/content/examples.html (original) +++ websites/production/camel/content/examples.html Mon Mar 19 09:18:42 2012 @@ -91,7 +91,7 @@

Examples

- +
More examples
See also Tutorials for more examples, as well as Cookbook.
Added: websites/production/camel/content/twitter-websocket-example.data/gaga.png ============================================================================== Binary file - no diff available. Propchange: websites/production/camel/content/twitter-websocket-example.data/gaga.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: websites/production/camel/content/twitter-websocket-example.data/twitter-apps.png ============================================================================== Binary file - no diff available. Propchange: websites/production/camel/content/twitter-websocket-example.data/twitter-apps.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: websites/production/camel/content/twitter-websocket-example.html ============================================================================== --- websites/production/camel/content/twitter-websocket-example.html (added) +++ websites/production/camel/content/twitter-websocket-example.html Mon Mar 19 09:18:42 2012 @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + Apache Camel: Twitter Websocket Example + + + +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + +
+

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

+ +
+
+ +
+ + +
+
+
+
+
+
+ +
+
+
+© 2004-2011 The Apache Software Foundation. +
+Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners. +
+Graphic Design By Hiram +
+ + + + + + + +