diff options
author | luxagraf <sng@luxagraf.net> | 2016-03-31 09:52:45 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-03-31 09:52:45 -0400 |
commit | e6ea31a213da6306caa0392c8d18c2d0ac0111db (patch) | |
tree | 23a5bdd55c74b975a071f5350dfbc23dac1bbcca /app/syndication/medium.py | |
parent | de69d12ea824450a61a9621a0092739cc1fb6d8b (diff) |
Added migrations for src so I can rename Entry to Post. Changed
syndication file name
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"] |