Commit d8089cd1 authored by Okhin's avatar Okhin
Browse files

Adding an opengrap parser on Article.add_new_url

parent ab0c8db4
Pipeline #2533 failed with stages
in 31 seconds
......@@ -6,6 +6,7 @@ from taggit.managers import TaggableManager
from newspaper import Article as ArticleParser
from django_und.models import VoteMixin
from django_fsm import FSMField, transition, RETURN_VALUE
import opengraph as og
from io import BytesIO
from datetime import datetime
......@@ -183,6 +184,8 @@ class Article(VoteMixin):
if by is not None:
# Let's get metadata import
article.metadata = og.OpenGraph(url=url)
return article
......@@ -15,4 +15,5 @@ url
-e git+
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment