Skip to content

Commit

Permalink
move from url2png to webyshots (free)
Browse files Browse the repository at this point in the history
  • Loading branch information
barmstrong committed Nov 10, 2012
1 parent 2413fd7 commit 0764af1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -22,7 +22,6 @@ gem 'aws-ses', '0.4.4', :require => 'aws/ses'
gem 'exception_notification_rails3', '1.2.0', :require => 'exception_notifier'
gem 'mongoid_rails_migrations', '0.0.14'
gem 'dalli', '1.1.3'
gem 'url2png', '0.0.6'
gem 'redcarpet', '2.0.0'
gem 'heroku', '2.20.1'

Expand Down
12 changes: 8 additions & 4 deletions app/helpers/account/themes_helper.rb
Expand Up @@ -2,12 +2,16 @@ module Account::ThemesHelper

def theme_image theme, size="210x150"
if Rails.env.production?
Url2png::Config.public_key = 'P4ED717C89A831'
Url2png::Config.shared_secret = 'SCFD8EF851C0B1'
url = "http://support.ribbot.com/?theme_preview=#{theme.id}"
site_image_tag(url, :size => size).html_safe
url = "support.ribbot.com/?theme_preview=#{theme.id}"
site_image_tag(webyshots_url(url, size), :size => size).html_safe
else
image_tag "http://placehold.it/#{size}"
end
end

def webyshots_url(url, size)
safe_url = CGI.escape(url)
token = Digest::MD5.hexdigest("#{ENV['WEBYSHOTS_SECRET']}+#{safe_url}")
"http://api.webyshots.com/v1/shot/#{ENV['WEBYSHOT_KEY']}/#{token}/#{safe_url}/png/#{size}"
end
end
1 change: 1 addition & 0 deletions app/views/forums/index.html.erb
Expand Up @@ -2,6 +2,7 @@
<%= link_to '+ Create A Forum', new_forum_path, :class => "btn btn-primary" %>
</div>
<h1>My Forums</h1>

<br/>

<table class="table">
Expand Down
3 changes: 0 additions & 3 deletions config/initializers/url2png.rb

This file was deleted.

0 comments on commit 0764af1

Please sign in to comment.