code: def generate_news_url(query, first, recent, country_code):
      
      query = '+'.join(query.split())
      url = 'http://www.bing.com/news/search?q=' + query + '&first' + first
      if recent in ['h', 'd', 'w', 'm', 'y']: # A True/False would be enough. This is just to maintain consistancy with google.
          url = url + '&qft=sortbydate%3d%221%22'
      if country_code is not None:
          url += '&cc=' + country_code
      return url
docs: (str, str) -> str
      A url in the required format is generated.