Sha256: b347acff5505a17a89a15b31dd8f7e5b3ba51eedfddd4782d43eb3c19d2ec8af

Contents?: true

Size: 976 Bytes

Versions: 39

Compression:

Stored size: 976 Bytes

Contents

require "uri"
require "open-uri"

require 'rabbit/source/base'

module Rabbit
  module Source
    class SlideShare

      include Base

      class << self
        def initial_args_description
          N_("[USER] and [TITLE]")
        end
      end

      def initialize(encoding, logger, user, title)
        @user = user
        @title = title
        @uri = ::URI.parse("#{slide_uri}/download")
        super(encoding, logger)
        @last_modified = nil
      end

      private
      def _read
        begin
          @uri.open do |f|
            @last_modified = f.last_modified
            f.read
          end
        rescue
          @logger.error($!.message)
          @last_modified = Time.now
          ""
        end
      end

      def init_base
        set_base(slide_uri)
      end

      def last_modified
        @last_modified ||= Time.now
      end

      def slide_uri
        "http://www.slideshare.net/#{@user}/#{@title}"
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
rabbit-2.2.1 lib/rabbit/source/slide-share.rb
rabbit-2.2.0 lib/rabbit/source/slide-share.rb
rabbit-2.1.9 lib/rabbit/source/slide-share.rb
rabbit-2.1.8 lib/rabbit/source/slide-share.rb
rabbit-2.1.7 lib/rabbit/source/slide-share.rb
rabbit-2.1.6 lib/rabbit/source/slide-share.rb
rabbit-2.1.5 lib/rabbit/source/slide-share.rb
rabbit-2.1.4 lib/rabbit/source/slide-share.rb
rabbit-2.1.3 lib/rabbit/source/slide-share.rb
rabbit-2.1.2 lib/rabbit/source/slide-share.rb
rabbit-2.1.1 lib/rabbit/source/slide-share.rb
rabbit-2.1.0 lib/rabbit/source/slide-share.rb
rabbit-2.0.9 lib/rabbit/source/slide-share.rb
rabbit-2.0.8 lib/rabbit/source/slide-share.rb
rabbit-2.0.7 lib/rabbit/source/slide-share.rb
rabbit-2.0.6 lib/rabbit/source/slide-share.rb
rabbit-2.0.5 lib/rabbit/source/slide-share.rb
rabbit-2.0.4 lib/rabbit/source/slide-share.rb
rabbit-2.0.3 lib/rabbit/source/slide-share.rb
rabbit-2.0.2 lib/rabbit/source/slide-share.rb