def connect
      uri = URI.parse("https://userstream.twitter.com/2/user.json?track=#{@screen_name}")

      https = Net::HTTP.new(uri.host, uri.port)
      https.use_ssl = true
      https.ca_file = @ca_file
      https.verify_mode = OpenSSL::SSL::VERIFY_PEER
      https.verify_depth = 5

      https.start do |https|
        request = Net::HTTP::Get.new(uri.request_uri,
                                     "User-Agent" => @user_agent,
                                     "Accept-Encoding" => "identity")
        request.oauth!(https, @credential.consumer, @credential.access_token)

        buf = ""
        https.request(request) do |response|
          response.read_body do |chunk|
            buf << chunk
            while ((line = buf[/.+?(\r\n)+/m]) != nil)
              begin
                buf.sub!(line, "")
                line.strip!
                status = Yajl::Parser.parse(line)
              rescue
                break
              end

              yield status
            end
          end
        end
      end
    end
def connect
      uri = URI.parse("https://userstream.twitter.com/2/user.json?track=#{@screen_name}")

      https = Net::HTTP.new(uri.host, uri.port)
      https.use_ssl = true
      https.ca_file = @ca_file
      https.verify_mode = OpenSSL::SSL::VERIFY_PEER
      https.verify_depth = 5

      https.start do |https|
        request = Net::HTTP::Get.new(uri.request_uri,
                                     "User-Agent" => @user_agent,
                                     "Accept-Encoding" => "identity")
        request.oauth!(https, @credential.consumer, @credential.access_token)

        buf = ""
        https.request(request) do |response|
          response.read_body do |chunk|
            buf << chunk
            while ((line = buf[/.+?(\r\n)+/m]) != nil)
              begin
                buf.sub!(line, "")
                line.strip!
                status = Yajl::Parser.parse(line)
              rescue
                break
              end

              yield status
            end
          end
        end
      end
    end
Connects to UserStreaming API.

 The block will be given the events or statuses from Twitter API in JSON format.