lib/rubytter.rb in jugyo-rubytter-0.4.2 vs lib/rubytter.rb in jugyo-rubytter-0.4.3

- old
+ new

@@ -8,11 +8,11 @@ class Rubytter class APIError < StandardError; end APP_NAME = 'Rubytter' - VERSION = '0.4.2' + VERSION = '0.4.3' HOMEPAGE = 'http://github.com/jugyo/rubytter' def initialize(login, password, options = {}) @login = login @password = password @@ -80,9 +80,16 @@ update_status(params.merge({:status => status})) end def direct_message(user, text, params = {}) send_direct_message(params.merge({:user => user, :text => text})) + end + + def search(query = '', params = {}) + params = params.merge({:q => query}) unless query.empty? + path = '/search.json?' + to_param_str(params) + req = create_request(Net::HTTP::Post.new(path)) + http_request(req, nil, "search.#{@host}") end def get(path, params = {}) path += '.json' param_str = '?' + to_param_str(params)