mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 16:52:16 +00:00
🐛 fix build
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from django import forms
|
||||
from .helpers import get_link_preview_data
|
||||
from .models import BlogPost, Entry, Link, News, Poll, Video
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import requests
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def get_link_preview_data(link):
|
||||
"""gets the link preview json response from LinkPreview api"""
|
||||
api_url = "https://api.linkpreview.net"
|
||||
api_key = settings.LINK_PREVIEW_API_KEY
|
||||
target = link
|
||||
|
||||
# TODO: Add additional field `image_size` to help validate image https://docs.linkpreview.net/#image-processing-and-validation
|
||||
response = requests.get(
|
||||
api_url,
|
||||
headers={'X-Linkpreview-Api-Key': api_key},
|
||||
params={'q': target},
|
||||
)
|
||||
return response.json()
|
||||
# import requests
|
||||
#
|
||||
# from django.conf import settings
|
||||
#
|
||||
#
|
||||
# def get_link_preview_data(link):
|
||||
# """gets the link preview json response from LinkPreview api"""
|
||||
# api_url = "https://api.linkpreview.net"
|
||||
# api_key = settings.LINK_PREVIEW_API_KEY
|
||||
# target = link
|
||||
#
|
||||
# # TODO: Add additional field `image_size` to help validate image https://docs.linkpreview.net/#image-processing-and-validation
|
||||
# response = requests.get(
|
||||
# api_url,
|
||||
# headers={'X-Linkpreview-Api-Key': api_key},
|
||||
# params={'q': target},
|
||||
# )
|
||||
# return response.json()
|
||||
|
||||
Reference in New Issue
Block a user