Class: Olam::Api
- Inherits:
-
Object
- Object
- Olam::Api
- Defined in:
- lib/olam.rb
Instance Method Summary collapse
Instance Method Details
#search(term) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/olam.rb', line 5 def search(term) request_body = {timestampajax: Time.now.to_i, seq: 6, ajax_type: 'definition', word: term} response = HTTParty.post('http://mashithantu.com/dictionary/ajaxdict.php', body: request_body) str = sanitize(response.to_s) (str.scan(/ (\w+)<br>/) + str.scan(/ (\w+)<br \/>/)).join('|') end |