zapnap / retweet

A simple Twitter application template, built in Ruby with Sinatra and DataMapper

This URL has Read+Write access

nelstrom (author)
Sat Jul 25 04:49:16 -0700 2009
zapnap (committer)
Sat Oct 17 13:43:34 -0700 2009
commit  bee74de8aacb044b6e5c12d04b50240e5524bbbf
tree    648c2c0af136722c4d390ecea367d9a9dfea175c
parent  278da8c6237d2197814fd6b40a72af808854e416
retweet / README.rdoc
100644 26 lines (14 sloc) 1.288 kb

Retweet: A Twitter Application Template

A base application template for building simple Twitter web apps with Sinatra and DataMapper. If you just want to build a simple keyword-based aggregator (such as tweetdreams.org), all you need to do is edit environment.rb to set the name of your app and the API search keyword(s), edit the CSS, and go.

Configuration

Dependencies and all configuration is done in environment.rb. Your database is also set up here. DataMapper will use sqlite3 by default. Tests use the sqlite3-memory adapter (no configuration needed).

Add your controller actions in application.rb. Views for these actions are placed in the views directory. Static files, including a stock stylesheet, go in the public directory. Models go in the lib directory and are auto-loaded.

Testing

Rspec is included in the template. Add your specs in spec; just require spec_helper.rb to pre-configure the test environment. To run the specs:

  rake spec

Getting Started

  rake db:migrate
  rake twitter:update
  ruby application.rb

Status Updates

Run rake twitter:update to update the cached tweets. You can schedule this as a cron job to fire every few minutes if you like.