lib/lanyrd/client.rb in lanyrd-1.0.0 vs lib/lanyrd/client.rb in lanyrd-1.1.0
- old
+ new
@@ -1,8 +1,12 @@
module Lanyrd
class Client
- def search(query)
- get("search/?q=#{query}")['sections'][0]['rows']
+
+ # Specify search term with params.
+ # Params include :topic => topic
+ def search(query, params = {})
+ params = URI.escape(params.collect{|k,v| "#{k}=#{v}"}.join('&')).insert 0, "&"
+ get("search/?q=#{query}#{params}")['sections'][0]['rows']
end
def popular
get("search/")['sections'][0]['rows']
end
\ No newline at end of file