Class: TwitPhoto::Adaptors::TwitPicAdaptor

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

Class Method Summary collapse

Class Method Details

.getImageUrl(url) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/adaptors.rb', line 32

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

    uri = URI.parse(url)
    id = uri.path

    return "http://twitpic.com/show/thumb" + id 
end