Class: Shortie::Shorteners::Rubyurl
- Inherits:
-
BaseShortener
- Object
- BaseShortener
- Shortie::Shorteners::Rubyurl
- Defined in:
- lib/shortie/shorteners/rubyurl.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 |
# File 'lib/shortie/shorteners/rubyurl.rb', line 4 def shorten xml = SimpleHttp.post("http://rubyurl.com/api/links", "website_url" => url) doc = REXML::Document.new(xml) doc.elements["link/permalink"].text end |