39def response(resp):
40 results = []
41
42 data = loads(extr(resp.text, 'var data = ', ';\n'))
43
44
45 for result in data['filtered']['data']:
46 result = result[result['type']]
47 videoid = result['uri'].split('/')[-1]
48 url = base_url + videoid
49 title = result['name']
50 thumbnail = result['pictures']['sizes'][-1]['link']
51 publishedDate = parser.parse(result['created_time'])
52
53
54 results.append(
55 {
56 'url': url,
57 'title': title,
58 'content': '',
59 'template': 'videos.html',
60 'publishedDate': publishedDate,
61 'iframe_src': "https://player.vimeo.com/video/" + videoid,
62 'thumbnail': thumbnail,
63 }
64 )
65
66
67 return results