Class: Shortie::Shorteners::Minilink
- Inherits:
-
BaseShortener
- Object
- BaseShortener
- Shortie::Shorteners::Minilink
- Defined in:
- lib/shortie/shorteners/minilink.rb
Instance Attribute Summary
Attributes inherited from BaseShortener
Instance Method Summary collapse
Methods inherited from BaseShortener
Constructor Details
This class inherits a constructor from Shortie::BaseShortener
Instance Method Details
#shorten ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/shortie/shorteners/minilink.rb', line 4 def shorten xml = SimpleHttp.get("http://minilink.org/?url=#{escaped_url}&xml=1") doc = REXML::Document.new(xml) url_element = doc.elements["minilink"] raise "No URL returned from minilink." if url_element.nil? url_element.text end |