Created
January 20, 2014 22:58
-
-
Save RichardHyde/8531089 to your computer and use it in GitHub Desktop.
Post to Day One Sublime Text 2 Command
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 sublime, sublime_plugin | |
import urllib, webbrowser | |
class PostToDayOneCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
selections = self.view.sel() | |
selection = self.view.substr(selections[0]) | |
url = "dayone://post?entry=%s" % urllib.quote(selection) | |
f = webbrowser.open(url) | |
self.view.replace(edit, selections[0], "") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment