Tweet History via CouchDB & JQuery Sparklines!

September 6th, 20116:41 am

0


Wanting to play more with CouchDB I thought of this small little project.

The goal was to graph the number of tweets per day I made over 2010.  So began the journey.

  1. Download all tweets from api.twitter.com in json format.
  2. Install CouchDB on dev machine localhost.
  3. Insert all tweets into CouchDB.  CouchDB talks json so this was easy.
  4. Map & Reduce tweets so I can get a daily count of all my tweets.
  5. Sign-up for free CouchDB on Cloudant.com.  No need to host it myself.
  6. Replicate localhost CouchDB to Cloudant CouchDB.  One click with CouchDB’s replicate ability.
  7. Using JQuery I called my REST based CouchDB twitter count feed and limited it to just 2010 tweets.
  8. Using JQuery Sparklines and some Javascript *magic we get a graph of my tweets over the year 2010!!

*Magic means 1000′s of google searches, debug output lines, errors and a few head scratches.

I also played with some other sparkline capabilities, doing some brainstorming for future projects.
I am starting to love CouchDB.  The elegant simplicity and capability is the perfect match for today’s web.

You can see the live demo here: http://www.jameseisenhauer.com/smpl/jspark/

 

 

Related posts: