lib/imgur.rb
def upload_from_url image_url
			c = Curl::Easy.new("http://imgur.com/api/upload.json")
			c.http_post(Curl::PostField.content('key', @api_key), Curl::PostField.content('image', image_url))
			response = Crack::JSON.parse c.body_str
			raise ImgurError, response["rsp"]["error_msg"] if response["rsp"]["stat"] == "fail"
			response["rsp"]["image"]
		end
# Uploads a file from a remote URL
#
# @param [String] image_url The URL of the image to upload
# @raise [ImgurError]
# @return [Hash] Image data
Uploads a file from a remote URL
Uploads a file from a remote URL
def upload_from_url image_url
			c = Curl::Easy.new("http://imgur.com/api/upload.json")
			c.http_post(Curl::PostField.content('key', @api_key), Curl::PostField.content('image', image_url))
			response = Crack::JSON.parse c.body_str
			raise ImgurError, response["rsp"]["error_msg"] if response["rsp"]["stat"] == "fail"
			response["rsp"]["image"]
		end
def upload_from_url image_url c = Curl :: Easy . new ( "http://imgur.com/api/upload.json" ) c . http_post ( Curl :: PostField . content ( 'key' , @api_key ) , Curl :: PostField . content ( 'image' , image_url ) ) response = Crack :: JSON . parse c . body_str raise ImgurError , response [ "rsp" ] [ "error_msg" ] if response [ "rsp" ] [ "stat" ] == "fail" response [ "rsp" ] [ "image" ] end
Uploads a file from a remote URL
Uploads a file from a remote URL
None
Hash
None
image_url
image_url The URL of the image to upload
image_url The URL of the image to upload