My attention today has been focussed on the third service that is under development as part of the Aus-e-Stage project which is in turn part of the larger AusStage project. The focus of this third service is to use mobile based technologies to solicit feedback in real time from audience members who are attending, or have just attended, a performance.
The two main mechanisms for soliciting feedback I’m currently focused on are SMS and Twitter messages.
My current task is exploring the way in which we can interact with Twitter in order to retrieve messages, via the Twitter API, that are pieces of feedback for performances that we’re interested in. All of our development to-date has been in the Java programming language and as such I’ve been looking into libraries that I can used to make it easier for my development work. The library I’m starting with the tweetStream4J library by John Crepezzi.
He uses Git for his source code repository and Apache Maven as his build tool. Whereas we’re using Apache Subversion and Apache Ant respectively. All of our source code is hosted as the Aus-e-Stage project on Google Code. To keep things separate and easy to manage I’ve decided to set aside a directory specifically for compiling and packaging the library so that I can use my already established processes with my own preferred tools for my development.
To do this I undertook the following tasks:
Note: This is not intended as a full procedure. It is rather a list of notes to act as a reminder to me and a prompt to others who may be experiencing similar issues to those that I had.
1. Configuring my System
- Install the git-core package including dependencies
- Install the maven2 package including dependencies
2. Checkout / Clone the tweetStream4J Repository
- Create a directory to store files related to development
mkdir mobile-tools - Navigate to the newly created directory
cd mobile-tools - Clone the tweetStream4J repository
git clone http://github.com/seejohnrun/tweetStream4J.git - A newly created
tweetStream4Jdirectory will be created in themobile-toolsdirectory that contains the repository
3. Compile the tweetStream4J code using Maven
- Navigate to the newly created tweetStream4J directory
cd tweetStream4J - Compile the source code using Maven
mvn compile - All of the required dependencies will be automatically downloaded into the
~/.m2/repositorydirectory - The compiled classes will be in the ./target directory
4. Edit the Tests in preparation for packaging
- Stay in the tweetStream4J directory
- Navigate to the following directory
./src/test/java/com/crepezzi/tweetStream4j - Open the following file for editing
./APITest.java - Locate the following line
private static final TwitterStreamConfiguration tws = new TwitterStreamConfiguration("seejohnrun", ""); - Change the line so that it includes your Twitter username and password. For example:
private static final TwitterStreamConfiguration tws = new TwitterStreamConfiguration("myuser", "mypass"); - Save the changed file
5. Package the tweetStream4J code using Maven
- Navigate to the main tweetStream4J directory
cd ../../../../../../ - Package the compiled classes using Maven
mvn package - All of the required dependencies will be automatically downloaded into the
~/.m2/repositorydirectory - The packaged jar file will be in the
./targetdirectory
6. Use the Packaged tweetStream4J Library
- Copy the packaged library to the required location
- Ensure the other required dependencies are in your class path or in the same location as the library
- At the time of writing the list included:
7. Keeping the Source Code Updated
- Navigate to the mobile-tools directory
- Navigate to the tweetStream4J directory
cd tweetStream4J - Update the source code with the following command
git pull - Repeat steps 4 and 5 above to recompile and package the library
The “Twitter Bling” image was uploaded to Flickr by Dave Mott and used under the terms of a Creative Commons License.
