Skip to content

Instantly share code, notes, and snippets.

@teeparham
Created September 16, 2010 20:22
Show Gist options
  • Save teeparham/583099 to your computer and use it in GitHub Desktop.
Save teeparham/583099 to your computer and use it in GitHub Desktop.
Serve Pingdom uptime image from an https site
%h1 Uptime
= image_tag uptime_image_path, :height => "165", :width => "300"
map.uptime_image '/pingdom_uptime_image', :controller => 'something', :action => 'uptime_image'
class SomethingController < ApplicationController
require 'net/http'
include SslRequirement
def ssl_required?
true
end
def index
# do your stuff
end
def uptime_image
img = URI.parse("http://share.pingdom.com/banners/123secrets")
send_data Net::HTTP.get(img), :content_type => 'image/png', :disposition => 'inline'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment