Module: Imagize

Defined in:
lib/imagize.rb

Defined Under Namespace

Classes: Imagizer

Constant Summary collapse

URL_DEFINITIONS =
{
  :twitpic => {
    :url => "http://twitpic.com/",
    :convert => "http://twitpic.com/show/large/§ID§"
  },
  :yfrog =>{
    :url => "http://yfrog.com/",    
    :convert => "http://yfrog.com/§ID§:iphone"
  },  
  :youtube_short => {
    :url => "http://youtu.be/",    
    :convert => "http://img.youtube.com/vi/§ID§/0.jpg"      
  },            
  # :youtube_long => {
  #   :url => "http://www.youtube.com/watch",
  #   :convert => "http://img.youtube.com/vi/§ID§/0.jpg"
  # }, 
  :tweetphoto => {
    :url => "http://tweetphoto.com/",
    :convert => "http://tweetphotoapi.com/api/TPAPI.svc/imagefromurl?size=big&url=http://tweetphoto.com/§ID§"
  },
  :lockerz => {
    :url => "http://lockerz.com/s/",
    :convert => "http://api.plixi.com/api/tpapi.svc/imagefromurl?size=big&url=http://lockerz.com/s/§ID§"
  },
  :plixi => {
    :url => "http://plixi.com/p/",
    :convert => "http://api.plixi.com/api/tpapi.svc/imagefromurl?size=big&url=http://plixi.com/§ID§"
  },

  :twitgoo => {
    :url => "http://twitgoo.com/",
    :convert => "http://twitgoo.com/show/img/§ID§"
  },
  :imgly =>{
    :url => "http://img.ly/",
    :convert => "http://img.ly/show/full/§ID§"      
  },
  :mobyto => {
    :url => "http://moby.to/",
    :convert => "http://moby.to/§ID§:full"      
  },        
  :instagram => {
    :url => "http://instagr.am/p/",
    :convert => "http://instagr.am/p/§ID§/media/?size=l"      
  }
}
SHORTENERS =
{
  :bitly => {
    :url=> "http://bit.ly/"
  },
  :jmp => {
    :url=> "http://j.mp/"
  },            
  :isgd =>{
    :url=>"http://is.gd/"
  },
  :twitter=>{
    :url=>"http://t.co/"
  },
  :lytsr=>{
    :url=>"http://lyt.sr/"
  },
  :google=>{
    :url=>"http://goo.gl/"
  }
}
IMAGE_URL =
/http:\/\/[.\w]*\/[\/\w]*/
JPG_FINDER =

IMAGE_URL = ///*/[/w]*+/

/#{IMAGE_URL}.jpg/
GIF_FINDER =
/#{IMAGE_URL}.gif/
PNG_FINDER =
/#{IMAGE_URL}.png/
IMAGE_FINDERS =
[JPG_FINDER, GIF_FINDER, PNG_FINDER]
YOUTUBE_LONG_URL =
"www.youtube.com/watch"
YOUTUBE_LONG_CONVERT_URL =
"http://img.youtube.com/vi/§ID§/0.jpg"
CLOUD_APP =
"http://cl.ly/"