Created
November 24, 2015 03:15
-
-
Save viticci/3b332dfb00a1ca67f230 to your computer and use it in GitHub Desktop.
Selection.py
This file contains 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
# coding: utf-8 | |
import sys | |
import html2text | |
import clipboard | |
import webbrowser | |
webpage = clipboard.get() | |
text = sys.argv[1] | |
h = html2text.HTML2Text() | |
h.body_width = 0 | |
converted = h.handle(text) | |
clipboard.set('> ' + converted) | |
webbrowser.open('safari-' + webpage) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment