Permalink
Browse files

Add /quote route for retrieving one random quote for external APIs.

  • Loading branch information...
1 parent b30aec0 commit 915384f6d7c4c6748e7fccbe61314185f5fbd579 @jarmo committed May 26, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 hackersays.rb
View
@@ -54,6 +54,11 @@ def random_quotes
Array.new(10) {quotes[ids[rand count]]}
end
+ get '/quote' do
+ content_type 'application/json', :charset => 'utf-8'
+ Yajl::Encoder.encode random_quotes.first
+ end
+
get '/quotes' do
content_type 'application/json', :charset => 'utf-8'
Yajl::Encoder.encode random_quotes

0 comments on commit 915384f

Please sign in to comment.