151 raw_search_results = loads(resp.text)
154 if not raw_search_results:
157 search_results = raw_search_results.get(
'channels', [])
159 if len(search_results) == 0:
162 for result
in search_results[0].get(
'items', []):
164 if search_type ==
'image':
167 result_url = result[
'url']
168 elif 'link' in result:
169 result_url = result[
'link']
177 'title': result[
'title'],
179 'img_src': result[
'image'],
180 'template':
'images.html',
187 if 'pubDate' in result:
188 publishedDate = parser.parse(result[
'pubDate'])
193 'url': result[
'link']
or '',
194 'title': result[
'title'],
195 'content': html_to_text(result[
'description']),
196 'publishedDate': publishedDate,