150 raw_search_results = loads(resp.text)
153 if not raw_search_results:
156 search_results = raw_search_results.get(
'channels', [])
158 if len(search_results) == 0:
161 for result
in search_results[0].get(
'items', []):
163 if search_type ==
'image':
166 result_url = result[
'url']
167 elif 'link' in result:
168 result_url = result[
'link']
176 'title': result[
'title'],
178 'img_src': result[
'image'],
179 'template':
'images.html',
186 if 'pubDate' in result:
187 publishedDate = parser.parse(result[
'pubDate'])
192 'url': result[
'link']
or '',
193 'title': result[
'title'],
194 'content': html_to_text(result[
'description']),
195 'publishedDate': publishedDate,