Created
March 18, 2013 15:11
-
-
Save sebietter/5187852 to your computer and use it in GitHub Desktop.
This Script opens a URL, gets the name, adds the URL to it and opens the post in Felix.
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 | |
felixURL = 'felix://compose/post?text=' + post | |
webbrowser.open(felixURL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment