Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

ruby/sinatra extensions for implementing the twitter api

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 demo
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 twitter_server.gemspec
README.rdoc

twitter_server

This is an attempt at a Twitter API implementation on top of Sinatra. This is for all the people that experience Twitter purely through one or more of the great clients on top of it.

SUPER alpha, ruby API will probably change!

USAGE

The public API that you should be concerned with is the Sinatra API. Similar to how Sinatra lets you respond to HTTP requests, this lets you respond to Twitter requests

require 'sinatra'
require 'twitter_server'

get '/' do
  'hello world'
end

twitter_statuses_home_timeline do |params|
  ...
end

The Sinatra Extension API is used, so you can also create separate Sinatra classes and mount them separately.

require 'sinatra/base'
require 'twitter_server'

class MyTwitterApp < Sinatra::Base
  register Sinatra::TwitterServer

  get '/' do
    'hello world'
  end

  twitter_statuses_home_timeline do |params|
    ...
  end
end

IDEAS

  • Wrap a blogging service (see Wordpress, Tumblr)

  • Get up-to-date event notifications on internal systems

  • Uh yes, clone Twitter. You can probably rewrite it in a weekend :)

See demo/faker_server.rb for an in-memory, randomly generated, read-only twitter server.

TODO

not implemented

  • XML/JSON parsing

  • Better XML/JSON/ATOM/RSS rendering

  • handle basic auth and oauth

  • cleanup pluggable renderers

  • gem packaging

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright © 2009 rick. See LICENSE for details.

Something went wrong with that request. Please try again.