Last active
December 20, 2015 13:39
-
-
Save tdhopper/6140068 to your computer and use it in GitHub Desktop.
Pythonista script for taking a URL on the clipboard, running it through Readability, then through Heck Yes Markdown, and finally dropping in Day One. Borrows heavily from http://www.macdrifter.com/2012/09/pythonista-trick-url-to-markdown.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clipboard | |
import urllib2 | |
import webbrowser | |
clipString = clipboard.get() | |
marky = 'http://heckyesmarkdown.com/go/?read=1&u=' | |
queryString = marky + clipString | |
reqMD = urllib2.Request(queryString) | |
openMD = urllib2.urlopen(reqMD) | |
content = (openMD.read().decode('utf-8')) | |
text = content.encode('utf-8') + '\n' | |
text = urllib2.quote(text, safe='') | |
webbrowser.open("dayone://post?entry="+text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment