Created
March 18, 2013 15:29
-
-
Save sebietter/5187987 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
import clipboard | |
import urllib | |
import urllib2 | |
import bs4 | |
import webbrowser | |
url = clipboard.get() | |
soup = bs4.BeautifulSoup(urllib.urlopen(url)) | |
title = soup.title.string | |
name = title.encode('utf-8') | |
print name | |
post = name + ' ' + url | |
post = urllib.quote(post) | |
print post | |
draftsURL = 'drafts://x-callback-url/create?text=' + post | |
draftsAction = '&action=Post%20to%20App.net' | |
drafts = draftsURL + draftsAction | |
webbrowser.open(drafts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment