# File lib/amazon/search.rb, line 872
      def text_stream_search(text_stream, mode='books', weight=HEAVY,
                             sort_type=nil, page=1, &block)

        # this search type not available for international sites
        unless @locale == 'us'
          raise LocaleError, "search type invalid in '#{@locale}' locale"

        url = AWS_PREFIX + "?t=%s&TextStreamSearch=%s&mode=%s&f=xml" +
        @type = WEIGHT[weight]
        sort_string = get_sort_string(sort_type, mode)

        modes = %w[electronics books videogames apparel toys photo
                   music dvd wireless-phones]
        unless modes.include? mode
          raise ModeError, "mode must be one of %s" % modes.join(', ')

        # strip a few useless words from the text stream
        %w[and or not the a an but to for of on at].each do |particle|
          text_stream.gsub!(/\b#{particle}\b/, '')

        text_stream = url_encode(text_stream)
        url =
          url % [@id, text_stream, mode, @type, @token, page] << sort_string

        search(url, &block)