92def response(resp):
93 results = []
94
95 for item in resp.json().get('data', []):
96 content = [item.get(i) for i in ['language', 'description'] if item.get(i)]
97
98 results.append(
99 {
100 'template': 'packages.html',
101 'url': item.get('html_url'),
102 'title': item.get('full_name'),
103 'content': ' / '.join(content),
104
105 'thumbnail': item.get('avatar_url') or item.get('owner', {}).get('avatar_url'),
106 'package_name': item.get('name'),
107 'maintainer': item.get('owner', {}).get('username'),
108 'publishedDate': parser.parse(item.get("updated_at") or item.get("created_at")),
109 'tags': item.get('topics', []),
110 'popularity': item.get('stars_count'),
111 'homepage': item.get('website'),
112 'source_code_url': item.get('clone_url'),
113 }
114 )
115
116 return results