prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bing news engine broken
  There is no result when I'm using the bang "!bing_news".
  
  
  </issue>
  <code>
  [start of searx/engines/bing_news.py]
  1 """
  2  Bing (News)
  3 
  4  @website     https://www.bing.com/news
  5  @provide-api yes (http://datamarket.azure.com/dataset/bing/search),
  6               max. 5000 query/month
  7 
  8  @using-api   no (because of query limit)
  9  @results     HTML (using search portal)
  10  @stable      no (HTML can change)
  11  @parse       url, title, content, publishedDate
  12 """
  13 
  14 from urllib import urlencode
  15 from cgi import escape
  16 from lxml import html
  17 from datetime import datetime, timedelta
  18 from dateutil import parser
  19 import re
  20 from searx.engines.xpath import extract_text
  21 
  22 # engine dependent config
  23 categories = ['news']
  24 paging = True
  25 language_support = True
  26 
  27 # search-url
  28 base_url = 'https://www.bing.com/'
  29 search_string = 'news/search?{query}&first={offset}'
  30 
  31 
  32 # do search-request
  33 def request(query, params):
  34     offset = (params['pageno'] - 1) * 10 + 1
  35 
  36     if params['language'] == 'all':
  37         language = 'en-US'
  38     else:
  39         language = params['language'].replace('_', '-')
  40 
  41     search_path = search_string.format(
  42         query=urlencode({'q': query, 'setmkt': language}),
  43         offset=offset)
  44 
  45     params['cookies']['_FP'] = "ui=en-US"
  46 
  47     params['url'] = base_url + search_path
  48 
  49     return params
  50 
  51 
  52 # get response from search-request
  53 def response(resp):
  54     results = []
  55 
  56     dom = html.fromstring(resp.content)
  57 
  58     # parse results
  59     for result in dom.xpath('//div[@class="sn_r"]'):
  60         link = result.xpath('.//div[@class="newstitle"]/a')[0]
  61         url = link.attrib.get('href')
  62         title = extract_text(link)
  63         contentXPath = result.xpath('.//div[@class="sn_txt"]/div//span[@class="sn_snip"]')
  64         content = escape(extract_text(contentXPath))
  65 
  66         # parse publishedDate
  67         publishedDateXPath = result.xpath('.//div[@class="sn_txt"]/div'
  68                                           '//span[contains(@class,"sn_ST")]'
  69                                           '//span[contains(@class,"sn_tm")]')
  70 
  71         publishedDate = escape(extract_text(publishedDateXPath))
  72 
  73         if re.match("^[0-9]+ minute(s|) ago$", publishedDate):
  74             timeNumbers = re.findall(r'\d+', publishedDate)
  75             publishedDate = datetime.now() - timedelta(minutes=int(timeNumbers[0]))
  76         elif re.match("^[0-9]+ hour(s|) ago$", publishedDate):
  77             timeNumbers = re.findall(r'\d+', publishedDate)
  78             publishedDate = datetime.now() - timedelta(hours=int(timeNumbers[0]))
  79         elif re.match("^[0-9]+ hour(s|), [0-9]+ minute(s|) ago$", publishedDate):
  80             timeNumbers = re.findall(r'\d+', publishedDate)
  81             publishedDate = datetime.now()\
  82                 - timedelta(hours=int(timeNumbers[0]))\
  83                 - timedelta(minutes=int(timeNumbers[1]))
  84         elif re.match("^[0-9]+ day(s|) ago$", publishedDate):
  85             timeNumbers = re.findall(r'\d+', publishedDate)
  86             publishedDate = datetime.now() - timedelta(days=int(timeNumbers[0]))
  87         else:
  88             try:
  89                 publishedDate = parser.parse(publishedDate, dayfirst=False)
  90             except TypeError:
  91                 publishedDate = datetime.now()
  92             except ValueError:
  93                 publishedDate = datetime.now()
  94 
  95         # append result
  96         results.append({'url': url,
  97                         'title': title,
  98                         'publishedDate': publishedDate,
  99                         'content': content})
  100 
  101     # return results
  102     return results
  103
  [end of searx/engines/bing_news.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/searx/engines/bing_news.py b/searx/engines/bing_news.py
  --- a/searx/engines/bing_news.py
  +++ b/searx/engines/bing_news.py
  @@ -65,7 +65,7 @@
   
           # parse publishedDate
           publishedDateXPath = result.xpath('.//div[@class="sn_txt"]/div'
  -                                          '//span[contains(@class,"sn_ST")]'
  +                                          '//div[contains(@class,"sn_ST")]'
                                             '//span[contains(@class,"sn_tm")]')
   
           publishedDate = escape(extract_text(publishedDateXPath))
  
verification_info: {"golden_diff": "diff --git a/searx/engines/bing_news.py b/searx/engines/bing_news.py\n--- a/searx/engines/bing_news.py\n+++ b/searx/engines/bing_news.py\n@@ -65,7 +65,7 @@\n \n         # parse publishedDate\n         publishedDateXPath = result.xpath('.//div[@class=\"sn_txt\"]/div'\n-                                          '//span[contains(@class,\"sn_ST\")]'\n+                                          '//div[contains(@class,\"sn_ST\")]'\n                                           '//span[contains(@class,\"sn_tm\")]')\n \n         publishedDate = escape(extract_text(publishedDateXPath))\n", "issue": "Bing news engine broken\nThere is no result when I'm using the bang \"!bing_news\".\n\n", "before_files": [{"content": "\"\"\"\n Bing (News)\n\n @website     https://www.bing.com/news\n @provide-api yes (http://datamarket.azure.com/dataset/bing/search),\n              max. 5000 query/month\n\n @using-api   no (because of query limit)\n @results     HTML (using search portal)\n @stable      no (HTML can change)\n @parse       url, title, content, publishedDate\n\"\"\"\n\nfrom urllib import urlencode\nfrom cgi import escape\nfrom lxml import html\nfrom datetime import datetime, timedelta\nfrom dateutil import parser\nimport re\nfrom searx.engines.xpath import extract_text\n\n# engine dependent config\ncategories = ['news']\npaging = True\nlanguage_support = True\n\n# search-url\nbase_url = 'https://www.bing.com/'\nsearch_string = 'news/search?{query}&first={offset}'\n\n\n# do search-request\ndef request(query, params):\n    offset = (params['pageno'] - 1) * 10 + 1\n\n    if params['language'] == 'all':\n        language = 'en-US'\n    else:\n        language = params['language'].replace('_', '-')\n\n    search_path = search_string.format(\n        query=urlencode({'q': query, 'setmkt': language}),\n        offset=offset)\n\n    params['cookies']['_FP'] = \"ui=en-US\"\n\n    params['url'] = base_url + search_path\n\n    return params\n\n\n# get response from search-request\ndef response(resp):\n    results = []\n\n    dom = html.fromstring(resp.content)\n\n    # parse results\n    for result in dom.xpath('//div[@class=\"sn_r\"]'):\n        link = result.xpath('.//div[@class=\"newstitle\"]/a')[0]\n        url = link.attrib.get('href')\n        title = extract_text(link)\n        contentXPath = result.xpath('.//div[@class=\"sn_txt\"]/div//span[@class=\"sn_snip\"]')\n        content = escape(extract_text(contentXPath))\n\n        # parse publishedDate\n        publishedDateXPath = result.xpath('.//div[@class=\"sn_txt\"]/div'\n                                          '//span[contains(@class,\"sn_ST\")]'\n                                          '//span[contains(@class,\"sn_tm\")]')\n\n        publishedDate = escape(extract_text(publishedDateXPath))\n\n        if re.match(\"^[0-9]+ minute(s|) ago$\", publishedDate):\n            timeNumbers = re.findall(r'\\d+', publishedDate)\n            publishedDate = datetime.now() - timedelta(minutes=int(timeNumbers[0]))\n        elif re.match(\"^[0-9]+ hour(s|) ago$\", publishedDate):\n            timeNumbers = re.findall(r'\\d+', publishedDate)\n            publishedDate = datetime.now() - timedelta(hours=int(timeNumbers[0]))\n        elif re.match(\"^[0-9]+ hour(s|), [0-9]+ minute(s|) ago$\", publishedDate):\n            timeNumbers = re.findall(r'\\d+', publishedDate)\n            publishedDate = datetime.now()\\\n                - timedelta(hours=int(timeNumbers[0]))\\\n                - timedelta(minutes=int(timeNumbers[1]))\n        elif re.match(\"^[0-9]+ day(s|) ago$\", publishedDate):\n            timeNumbers = re.findall(r'\\d+', publishedDate)\n            publishedDate = datetime.now() - timedelta(days=int(timeNumbers[0]))\n        else:\n            try:\n                publishedDate = parser.parse(publishedDate, dayfirst=False)\n            except TypeError:\n                publishedDate = datetime.now()\n            except ValueError:\n                publishedDate = datetime.now()\n\n        # append result\n        results.append({'url': url,\n                        'title': title,\n                        'publishedDate': publishedDate,\n                        'content': content})\n\n    # return results\n    return results\n", "path": "searx/engines/bing_news.py"}]}