Announcing Twackit
![]()
Last weekend I launched Twackit, which gives you a simple way to use Twitter to keep track of different kinds of metrics that are important to you… stuff like your weight, gas mileage, expenses, caloric intake, hours of sleep — pretty much anything with a simple numeric value and a hashtaggable category that you might want to keep track of over time.
There’s some basic content and reports are generated from the data you tweet to @twackit. I’ve gotten some good feedback, and a couple people are already using it for things I never thought of, which is really cool! I wanted to get something simple up and running and try to get people using it, then see what kinds of requirements shake out from real-world use cases.
Since this is a Rails-oriented blog, I thought I’d share a few technical details:
- Twackit is running on Rails 2.3.2, the current stable version.
- I’m using SQLite3 for development, but Heroku ignores your database.yml and uses Postgres, which is cool with me.
- It’s hosted on Heroku, which was very easy to set up in part because…
- I’m using Git for version control. The code is not open source (at least not yet), and I’m only using a local repo, so no GitHub.
- I used Haml for the layout and views, except for a few partials that encapsulate HTML and Javascript for third-party stuff, like Google Analytics and UserVoice. I just pasted their code into ERB templates.
- The reports use the Google Visualization API for things like the Annotated Time Line, which is really cool but not very useful until you have a lot of data. (So start adding data, everyone!)
- The Annotated Time Line wants Javascript Date objects. Unfortunately, Rails implements Date#to_json to return a String representation of the date, so I ended up hacking it to build a String of the form “new Date(year, month, day)”. I’ll keep looking for a better way.
- I used John Nunemaker‘s Twitter gem to call the Twitter search API and to get the user’s name and photo URL to make the report a little prettier.
- Twackit searches for new tweets every hour or so. To support very basic background jobs, Heroku invokes a rake task named “cron” (which I think is a terrible choice because of the name collision, but at least it’s intuitive).
- The cron rake task records some stats about each cron import, like how long it took, how many tweets were imported, and for how many distinct users. The task finishes in less than a second, since there isn’t much data coming in (yet!).
So please check Twackit out and let me know what you think. And of course, tell everyone about it!