 
 GOOGLE_API_KEY = process.env.GOOGLE_API_KEY
 GOOGLE_CUSTOM_SEARCH = process.env.GOOGLE_CUSTOM_SEARCH
-BING_SEARCH_API_KEY = process.env.BING_SEARCH_API_KEY
-USE_BING_V5 = process.env.USE_BING_V5
-MAX_RESULTS = process.env.MAX_SEARCH_RESULTS or 5
+MAX_RESULTS = process.env.MAX_SEARCH_RESULTS or 3
 
 DEF_SERVER_ERROR = "I'm unable to process your request at this time due to a server error. Please try again later."
 

                res.send results
    else
        robot.logger.warning "hubot-search: Missing GOOGLE_API_KEY or GOOGLE_CUSTOM_SEARCH in environment. Google Custom Search will not be available."

    # Listener: Bing Search API
    if BING_SEARCH_API_KEY?
        bing = new BingSearch robot
        # Use Bing Search API v5 if enabled, otherwise use legacy v2
        if USE_BING_V5?
            bing = new BingSearchV5 robot
        robot.respond /bing (.+)/i, id: "search.bing", (res) =>
            q = res.match[1]
            bing.search q, (results) =>
                res.send results
    else
robot.logger.warning "hubot-search: Missing BING_SEARCH_API_KEY in environment. Bing Search API will not be available."

        results += "About #{data.searchInformation.formattedTotalResults} results (#{data.searchInformation.formattedSearchTime} seconds)."
        results


module.exports = (robot) ->
    # Listener: Google Custom Search
