Screencast : Fun with Couchbase MapReduce and Twitter
I have created this simple screencast to show how you can, using Couchbase do some realtime analysis based on Twitter feed.
The key steps of this demonstration are
- Inject Tweets using a simple program available on my Github Couchbase-Twitter-Injector
- Create views to index and query the Tweets by
- User name
- Tags
- Date
The views that I used in this demonstration are available at the bottom of this post.
Views:
function (doc, meta) {
if (doc.created_at) {
emit( dateToArray(doc.created_at));
}
}function (doc, meta) {
if (doc.entities.hashtags.length > 0) {
for (i in doc.entities.hashtags) {
emit( doc.entities.hashtags[i].text );
}
}
}function (doc, meta) {
if ( doc.user.screen_name ) {
emit(doc.user.screen_name);
}
}