Sha256: 34162f0bef2edf67e9158d08bd4cefb85d2ffb784dd7acceca0b2d89e1f153c6
Contents?: true
Size: 624 Bytes
Versions: 121
Compression:
Stored size: 624 Bytes
Contents
require "#{File.dirname(__FILE__)}/../dataflow" require 'net/http' include Dataflow # Be gentle running this one Thread.abort_on_exception = true local do |port, stream, branding_occurences, number_of_mentions| unify port, Dataflow::Port.new(stream) 10.times { Thread.new(port) {|p| p.send Net::HTTP.get_response(URI.parse("http://www.cuil.com/search?q=#{rand(1000)}")).body } } Thread.new { unify branding_occurences, stream.take(10).map {|http_body| http_body.scan /cuil/ } } Thread.new { unify number_of_mentions, branding_occurences.map {|occurences| occurences.length } } puts number_of_mentions.inspect end
Version data entries
121 entries across 121 versions & 3 rubygems