A minimalistic Apache Camel application (one Java class with 150 lines) that streams live Twitter photos.
See live demo streaming Euro2016 photos camelympics.ofbizian.com
Read more about the app on my blog
How to run using Docker
The application is compiled and available at Docker Hub. Run the image using your own Twitter keys and preferred search term. For example:
docker run -e "consumerKey=83VYApZjhdkKJHDa3qq2dq" -e "consumerSecret=M00Lzd5XsHnvnRpips0LSKJDLSKJDLSKJDSApy1GFB9JjNhu" -e "accessToken=19341814-3592zsZ1LKAJDLSAKDJVB8Z2FvNweYA0nfHACO" -e "accessTokenSecret=ZBk0yIqjaBbWLAKSjdlskjdkLAKohve9wvgZj2XysiTo" -e "searchTerm=euro2016,sport" --rm -p 8080:8080 bibryam/camelympics:latest
How to run locally with Maven
Clone the project and update
app.properties as described below.
Then compile and run the app with the following command:
mvn clean compile exec:java
Then go to http://localhost:8080
To have a larger number of previews images (which is 4x4 by default) for example 50x7 use following URL params: http://localhost:8080?rows=50&cols=7
How to run on Red Hat OpenShift
If you have an OpenShift Online dev preview, use the following commands:
oc login https://OPENSHIFT_HOST --token=YOUR_TOKEN oc new-project camelympics oc new-app bibryam/camelympics:latest \ -e consumerKey="KEY" \ -e consumerSecret="SECRET" \ -e accessToken="TOKEN" \ -e accessTokenSecret="TOKEN_SECRET" \ -e searchTerm="your search term, for example: euro2016" oc expose svc camelympics
Generating Twitter keys
To generate Twitter consumer keys and accessToken, go to here, Create New App, and generate Access Token.
app.propertiesand compile the application, or simply pass the keys as environment variables.
Notice that the docker container on docker hub always expects environment variables and overrides the
app.properties. So when using Docker, there is no need to update
app.properties, instead pass the keys as environment variables.
The Camel application has a filter to discard possibly sensitive and NSFW content, but it is not always working as expected with a real time photo stream. Use this at your own risk!!!
Camelympics is licensed under The MIT License.
100% Free. Camelympics is free to use but attribution is required. This means you must leave footer links and the license info intact. That's all.