Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
rpteam
rp
Commits
d8089cd1
Commit
d8089cd1
authored
Apr 02, 2019
by
Okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding an opengrap parser on Article.add_new_url
parent
ab0c8db4
Pipeline
#2533
failed with stages
in 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
apps/rp/models.py
apps/rp/models.py
+3
-0
requirements.txt
requirements.txt
+1
-0
No files found.
apps/rp/models.py
View file @
d8089cd1
...
...
@@ -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
:
article
.
upvote
(
by
)
# Let's get metadata import
article
.
metadata
=
og
.
OpenGraph
(
url
=
url
)
article
.
save
()
return
article
...
...
requirements.txt
View file @
d8089cd1
...
...
@@ -15,4 +15,5 @@ url
coreapi
pygments
markdown
opengraph
-e git+https://github.com/mariocesar/sorl-thumbnail.git#egg=sorl-thumbnail
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment