Forked from n8henrie/Import Pythonista Script from Bookmarklet.py
Created
October 17, 2015 03:11
-
-
Save pathologicalhandwaving/722032f1b72efaed0580 to your computer and use it in GitHub Desktop.
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
# Posted at http://n8henrie.com/2013/02/quickly-import-pythonista-scripts-via-textexpander-or-bookmarklet | |
# Script Name: Import Pythonista Script from Bookmarklet | |
# I got help from here: http://twolivesleft.com/Codea/Talk/discussion/1652/what-others-do%3A-pythonista/p1 | |
# I got help from here: http://www.macdrifter.com/2012/09/pythonista-trick-url-to-markdown.html | |
# I got help from here: http://www.macstories.net/tutorials/from-instapaper-and-pythonista-to-dropbox-and-evernote-as-pdf/ | |
import sys | |
import urllib2 | |
import editor | |
import os | |
url = sys.argv[1] | |
scriptName = os.path.basename(url) | |
contents = urllib2.urlopen(url).read() | |
editor.make_new_file(scriptName[:-3], contents) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment