diff options
Diffstat (limited to 'app/syndication/medium.py')
-rw-r--r-- | app/syndication/medium.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/syndication/medium.py b/app/syndication/medium.py index 9787a1a..de157af 100644 --- a/app/syndication/medium.py +++ b/app/syndication/medium.py @@ -16,16 +16,16 @@ def post_to_medium(item): client = Client(application_id=settings.MEDIUM_CLIENT_ID, application_secret=settings.MEDIUM_CLIENT_SECRET) client.access_token = settings.MEDIUM_INT_TOKEN user = client.get_current_user() - head = '<p><i>This was originally posted <a href="https://luxagraf.net%s" rel="canonical">on my own site</a>.</i></p>' % item.content_object.get_absolute_url() - body = "%s %s" % (head, absolute_urls_for_syndication(item.content_object.body_html)) + head = '<p><i>This was originally posted <a href="https://luxagraf.net%s" rel="canonical">on my own site</a>.</i></p>' % item.get_absolute_url() + body = "%s %s" % (head, absolute_urls_for_syndication(item.body_html)) # Create a post. post = client.create_post( user_id=user["id"], - title=item.content_object.title, + title=item.title, content=body, content_format="html", - publish_status="draft" + publish_status="public", + canonicalUrl="https://luxagraf.net%s" % item.get_absolute_url(), + license="all-rights-reserved" ) - item.rel_link = post["url"] - item.status = 2 - item.save() + return post["url"] |