Sha256: e4e9dd16cfcd1eeedabf1775b10cf20cebf1456565ebb69da67b7b453cc8c78d

Contents?: true

Size: 460 Bytes

Versions: 2

Compression:

Stored size: 460 Bytes

Contents

require 'sinatra/base'
require 'haml'

class FlickrFakr < Sinatra::Base
  get '/' do
    'Welcome to Flickr Fakr!'
  end

  get '/services/auth/' do
    redirect 'http://localhost:9292/flickr/callback?frob=123'
  end

  post '/services/rest/' do
    args = {}
    request.body.rewind
    request.body.read.split('&').each { |arg| args[arg.split('=').first] = arg.split('=').last }
    view = "#{args['method']}.#{args['format']}"
    haml view.to_sym
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flickr_fakr-0.1.1 lib/flickr_fakr/flickr_fakr.rb
flickr_fakr-0.1.0 lib/flickr_fakr/flickr_fakr.rb