Created
December 4, 2013 20:08
-
-
Save ger-/7794594 to your computer and use it in GitHub Desktop.
chaining-lessn-tweetbot: Clicking this (javascript:window.location='pythonista://chaining-lessn-tweetbot?action=run&argv='+encodeURIComponent(document.location.href);) bookmarklet will launch this pythonista script to grab the webpage url and use Lessn to shorten it and then launch compose dialog of Tweetbot with the shortened url. Note: add you…
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 webbrowser | |
import clipboard | |
import urllib | |
import sys | |
import console | |
import urllib2 | |
l = sys.argv | |
link=l[1] | |
lessn='http://'yourdomain'/'x'/-/?api='API key'&url=' | |
link=urllib.quote(link,safe='') | |
short= lessn+link | |
u= urllib2.urlopen(short) | |
content = (u.read().decode('utf-8')) | |
clipboard.set(content) | |
tip=clipboard.get() | |
tip=urllib.quote(tip,safe='') | |
bot='tweetbot:///post?text=' | |
tweetbot= bot+tip+'/' | |
webbrowser.open(tweetbot) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment