linkding/bookmarks/views/api.py

12 lines
332 B
Python
Raw Normal View History

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