       "site:laravel.com/api/4.1 #{query}"
     else if version == 'php'
       "site:www.php.net/manual/en #{query}"
-    else if version?
-      "site:laravel.com/docs/#{version} #{query}"
     else
       "site:laravel.com/docs #{query}"
 

      .query(q: query)
      .get() (err, res, body) ->
        $ = cheerio.load body
        firstresult = $('li.g').first()
        url = firstresult.find('h3.r a').attr('href')
        jumpto = firstresult.find('.st .f a').attr('href')

        if jumpto?
          url = jumpto
        callback url if callback
  
  # this regex works fine, would like to fix the space after version though
  robot.hear /(([^:,\s!]+)[:,\s]+)?!docs\s([0-9.]+|api|dev|php)?\s?(.*)/i, (msg) ->
    user = msg.match[2]
    version = msg.match[3]
    query = msg.match[4]

htmlStrip = require 'htmlstrip-native'

SEARCH_URL = 'https://www.google.com/search'
USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36'
#Rommie=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17

module.exports = (robot) ->
  getQueryUrl = (version, query) ->
