152 raw_search_results = loads(resp.text)
155 if not raw_search_results:
158 search_results = raw_search_results.get(
'channels', [])
160 if len(search_results) == 0:
163 for result
in search_results[0].get(
'items', []):
165 if search_type ==
'image':
168 result_url = result[
'url']
169 elif 'link' in result:
170 result_url = result[
'link']
178 'title': result[
'title'],
180 'img_src': result[
'image'],
181 'template':
'images.html',
188 if 'pubDate' in result:
189 publishedDate = parser.parse(result[
'pubDate'])
194 'url': result[
'link']
or '',
195 'title': result[
'title'],
196 'content': html_to_text(result[
'description']),
197 'publishedDate': publishedDate,