TweetArchiver is a very simple Scala project that includes:
- A command line tool that uses dispatch-twitter to fetch a few tweets and insert them into a mongoDB collection using the Scala mongoDB driver.
- A tiny Scalatra servlet to display the tweets.
TwitterArchiver is a port of an example application from MongoDB in Action. It's a learning excercise and is not fit for any purpose other than experimentation.
-
Make sure
mongod
is alive and well% mongo MongoDB shell version: 2.0.4 connecting to: test > exit bye
-
Clone this repo
git clone https://github.com/alce/tweet-archiver.git cd tweet-archiver
-
Run Simple Build Tool
% sbt [info] Loading project definition from ... [info] Loading project definition from ... [info] Set current project to .. >
or Install SBT
-
Fetch some tweets and run the server. At the sbt command prompt type:
> run updater > container:start
-
Hit localhost:8080
If you execute > run updater
at the sbt prompt a couple of times, an exception will probably be thrown:
Reported exception:
java.lang.OutOfMemoryError: PermGen space
There's some info over at StackOverflow but I haven't looked into it.