# File lib/amazon/search.rb, line 713
      def keyword_search(keyword, mode='books', weight=HEAVY, page=1,
                         sort_type=nil, offerings=nil, price=nil,
                         editions=SINGLE_EDITION, &block)

        url = AWS_PREFIX + "?t=%s&KeywordSearch=%s&mode=%s&f=xml" +
              "&type=%s&dev-t=%s&page=%s"
        url << "&price=" << price unless price.nil?
        url << "&variations=yes"  if    editions == ALL_EDITIONS
        url << get_offer_string(offerings)
        @type = WEIGHT[weight]
        sort_string = get_sort_string(sort_type, mode)

        keyword = url_encode(keyword)

        unless Search.modes.include? mode
          raise ModeError, "mode must be one of %s" % Search.modes.join(', ')
        end

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

        search(url, &block)
      end