Class: TwitPhoto::Adaptors::YFrogAdaptor

Inherits:
Object
  • Object
show all
Defined in:
lib/adaptors.rb

Class Method Summary collapse

Class Method Details

.getImageUrl(url) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/adaptors.rb', line 46

def self.getImageUrl url
    # check for "http://yfrog." (no domain since yfrog supports many domains
    if url.index("http://yfrog.") != 0
      return nil
    end

    uri = URI.parse(url)
    id = uri.path
    
    return "http://yfrog.com" + id + ":medium"
end