Sha256: 13f9d01d877fd39f6f658ce5e992fd362397cb20e8f2e2f24742bd27b5ad83a6

Contents?: true

Size: 388 Bytes

Versions: 1

Compression:

Stored size: 388 Bytes

Contents

require 'nico/message'

alias :oldputs :puts
def puts(*args); end
require 'yajl/http_stream'
alias :puts :oldputs

module Nico
  class Listener
    def initialize(id, token)
      @url = "http://#{token}:x@streaming.campfirenow.com/room/#{id}/live.json"
    end

    def each
      Yajl::HttpStream.get(URI.parse @url) do |json|
        yield Message.new(json)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nico-0.1.1 lib/nico/room/listener.rb