Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0a1,2
- > # -*- coding: utf-8 -*-
- >
- 96,97c98,119
- <
- < SERVICES = [Twitpic,Yfrog,Movapic]
- ---
- >
- > require 'net/http'
- > class Instagram < Base
- > SERVICE_NAME = 'instagram'
- > REGEXP = /(http:\/\/instagr\.am\/p\/[a-zA-Z0-9]+)/
- > IMAGE_REGEXP = /property=\"og:image\" content=\"([ :\/\.\w]*)\"/
- >
- > def image_url(size = 'thumb')
- > uri = URI(self.url)
- > response = Net::HTTP.get_response(uri)
- > if IMAGE_REGEXP =~ response.body
- > url = $1
- > if size.to_s == 'large'
- > url = $1.gsub("_7.","_5.")
- > end
- > url
- > end
- > end
- >
- > end
- >
- > SERVICES = [Twitpic,Yfrog,Movapic,Instagram]
Add Comment
Please, Sign In to add comment