Sha256: 8dd2a4a22120fa4eaadb614ca3f81fd67fe69f941d1e25e8aa3dd9b56bedfc2d

Contents?: true

Size: 416 Bytes

Versions: 2

Compression:

Stored size: 416 Bytes

Contents

# http://stackoverflow.com/questions/7403553/how-do-i-get-the-counter-of-a-google-plus-1-button
module Virility
	class PlusOne < Context
	
	  parser(
	    Proc.new do |body, format|
	    	{'shares' => body.scan(/c: (\d+)/).flatten.first}
	    end
	  )
	
		def get_virility
			@response = self.class.get("https://plusone.google.com/_/+1/fastbutton?url=#{@url}")
			@counts = @response.parsed_response
		end
	
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
virility-0.0.2 lib/virility/strategies/plus_one.rb
virility-0.0.1 lib/virility/strategies/plus_one.rb