Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 20 lines (12 sloc) 475 Bytes
#!/usr/bin/env python
import gtk
import re
primary = gtk.clipboard_get(gtk.gdk.SELECTION_PRIMARY)
if not primary.wait_is_text_available() :
sys.exit(0)
s = primary.wait_for_text()
# If it's a LinkedIn URL, fix their stupid errors:
if re.search('(www\.)*linkedin.com/', s, flags=re.IGNORECASE):
s = s.replace("&", "&") + "&count=1000&paginationToken="
# eliminate newlines, and any spaces immediately following a newline:
print(re.sub(r'[\r\n]+ *', '', s))