Sha256: 478a70845d216b01a28e4230a61fdd743c8535ab9beb1c35c702fae731843e19

Contents?: true

Size: 334 Bytes

Versions: 8

Compression:

Stored size: 334 Bytes

Contents

module Virility
  class Pinterest < Strategy

    parser(
      Proc.new do |body, format|
        MultiJson.decode(body.scan(/(\{.+\})/).flatten.first)
      end
    )

    def census
      self.class.get("http://api.pinterest.com/v1/urls/count.json?url=#{@url}")
    end

    def count
      results["count"] || 0
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
virility-0.4.0 lib/virility/strategies/pinterest.rb
virility-0.3.1 lib/virility/strategies/pinterest.rb
virility-0.3.0 lib/virility/strategies/pinterest.rb
virility-0.2.0 lib/virility/strategies/pinterest.rb
virility-0.1.4 lib/virility/strategies/pinterest.rb
virility-0.1.3 lib/virility/strategies/pinterest.rb
virility-0.1.2 lib/virility/strategies/pinterest.rb
virility-0.1.1 lib/virility/strategies/pinterest.rb