Skip to content

Instantly share code, notes, and snippets.

Created November 16, 2014 06:19
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Open latest Draft article on either Byword or 1Writer
from requests import get
from json import loads
from urllib import quote
from webbrowser import open
email = 'YOUR EMAIL'
password = 'YOUR PASSWORD'
r = get('', auth=(email,password))
data = loads(r.content)
title = quote(data[0]['name'].encode('utf-8'))
article = quote(data[0]['content'].encode('utf-8'))
callback = 'onewriter://x-callback-url/create?name=' + title + '&text=' + article
#callback = 'byword://x-callback-url/new?name' + title + '&text=' + article
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment