Created
September 16, 2010 20:22
-
-
Save teeparham/583099 to your computer and use it in GitHub Desktop.
Serve Pingdom uptime image from an https site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%h1 Uptime | |
= image_tag uptime_image_path, :height => "165", :width => "300" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map.uptime_image '/pingdom_uptime_image', :controller => 'something', :action => 'uptime_image' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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