Created
March 8, 2014 23:12
-
-
Save sweinberg/9440460 to your computer and use it in GitHub Desktop.
Open Wikipedia pages in Articles. Requires Pythonista.
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
import clipboard | |
import string | |
import sys | |
import webbrowser | |
try: | |
article = sys.argv[1] | |
except IndexError: | |
article = clipboard.get() | |
article = article.replace('http://en.wikipedia.org/wiki/', 'x-articles://wikipedia.org/wiki/') | |
article = article.replace('https://en.wikipedia.org/wiki/', 'x-articles://wikipedia.org/wiki/') | |
article = article.replace('http://en.m.wikipedia.org/wiki/', 'x-articles://wikipedia.org/wiki/') | |
article = article.replace('https://en.m.wikipedia.org/wiki/', 'x-articles://wikipedia.org/wiki/') | |
webbrowser.open(article) |
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
javascript:window.location='pythonista://Articles?action=run&argv='+encodeURIComponent(document.location.href); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment