Sha256: 864ae6fc5ff94753646da57361e990a615f17f438b7cdcf3eec3f8fd6ebccd87

Contents?: true

Size: 650 Bytes

Versions: 109

Compression:

Stored size: 650 Bytes

Contents

class LinkserController < ApplicationController
  def index
    if params[:url].present?
      url = params[:url]
      begin
        o = Linkser.parse url, {:max_images => 1}
        if o.is_a? Linkser::Objects::HTML
          link = Link.new
          link.fill o
          render :partial => "links/link_preview", :locals => {:link => link}
          return
        end
      rescue
        render :partial => "links/error", :locals => {:message => I18n.t("link.errors.loading") + " " + url.to_s}     
        return   
      end
    end    
    render :partial => "links/error", :locals => {:message => I18n.t("link.errors.only_webs")}
  end
end

Version data entries

109 entries across 109 versions & 4 rubygems

Version Path
social_stream-2.2.2 linkser/app/controllers/linkser_controller.rb
social_stream-linkser-2.2.1 app/controllers/linkser_controller.rb
social_stream-2.2.1 linkser/app/controllers/linkser_controller.rb
social_stream-2.2.0 linkser/app/controllers/linkser_controller.rb
social_stream-linkser-2.2.0 app/controllers/linkser_controller.rb
social_stream-2.1.1 linkser/app/controllers/linkser_controller.rb
social_stream-1.1.12 linkser/app/controllers/linkser_controller.rb
social_stream-linkser-1.1.2 app/controllers/linkser_controller.rb
social_stream-2.1.0 linkser/app/controllers/linkser_controller.rb
social_stream-linkser-2.1.0 app/controllers/linkser_controller.rb
social_stream-2.0.4 linkser/app/controllers/linkser_controller.rb
social_stream-2.0.3 linkser/app/controllers/linkser_controller.rb
social_stream-1.1.11 linkser/app/controllers/linkser_controller.rb
social_stream-1.1.10 linkser/app/controllers/linkser_controller.rb
social_stream-1.1.9 linkser/app/controllers/linkser_controller.rb
social_stream-1.1.8 linkser/app/controllers/linkser_controller.rb
social_stream-2.0.2 linkser/app/controllers/linkser_controller.rb
social_stream-2.0.1 linkser/app/controllers/linkser_controller.rb
social_stream-2.0.0 linkser/app/controllers/linkser_controller.rb
social_stream-linkser-2.0.0 app/controllers/linkser_controller.rb