2019-07-02 07:34:12 +00:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2019-07-01 23:28:02 +00:00
|
|
|
from django.http import JsonResponse
|
|
|
|
|
2019-07-03 15:18:29 +00:00
|
|
|
from bookmarks.services.website_loader import load_website_metadata
|
2019-07-01 23:28:02 +00:00
|
|
|
|
|
|
|
|
2019-07-02 07:34:12 +00:00
|
|
|
@login_required
|
2019-07-06 06:14:13 +00:00
|
|
|
def website_metadata(request):
|
2019-07-01 23:28:02 +00:00
|
|
|
url = request.GET.get('url')
|
|
|
|
metadata = load_website_metadata(url)
|
|
|
|
return JsonResponse(metadata.to_dict())
|