Code Monkey home page Code Monkey logo

camelympics's Introduction

Camelympics

A minimalistic Apache Camel application (one Java class with 150 lines) that streams live Twitter photos.

Demo

See live demo streaming Euro2016 photos camelympics.ofbizian.com

Screenshot

A screenshot of the application

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

Then go to http://DOCKER_HOST:8080
To have a larger number of previews images (which is 4x4 by default) for example 50x7 use following URL params: http://DOCKER_HOST:8080?rows=50&cols=7

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

How to run on Staroid

See instructions here

Generating Twitter keys

  • To generate Twitter consumer keys and accessToken, go to here, Create New App, and generate Access Token.

  • Then update app.properties and 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.

Here are the keys that are needed

Other notes

  • The application can run on any platform that supports docker containers, such as Digital Ocean or Google Compute Engine.

  • 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!!!

License

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.

camelympics's People

Contributors

bibryam avatar leemoonsoo avatar

Stargazers

João Maia avatar Leif Gruenwoldt avatar  avatar Gan Dong avatar  avatar Aurélien De Fanti avatar Eduardo Briguenti Vieira avatar Genki Kondo avatar Peter Leibiger avatar Dominik Kunz avatar Robin Howlett avatar Stefaney Roberts avatar  avatar Fred Massart avatar Joe Atkins avatar Michel Graciano avatar Guido Zockoll avatar Ashwin Jayaprakash avatar Andy avatar Bruno Borges avatar Sebastian Peters avatar Leon Radley avatar

Watchers

 avatar Jason Chaffee avatar James Cloos avatar Eduardo Briguenti Vieira avatar  avatar

camelympics's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.