Class: Mush::Services::Zaebz
- Inherits:
-
Mush::Service
- Object
- Mush::Service
- Mush::Services::Zaebz
- Defined in:
- lib/mush/services/zaebz.rb
Instance Method Summary collapse
Methods inherited from Mush::Service
Instance Method Details
#shorten(url) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/mush/services/zaebz.rb', line 6 def shorten(url) if url.empty? || url !~ %r(^https?://.+) raise InvalidURI.new("Please provide a valid URI") end post('/', { :url => url }).body.match(/href="(.+)"/)[1] end |