Last active
August 29, 2015 14:23
-
-
Save embayer/eff1ffa5a9ddb285419d to your computer and use it in GitHub Desktop.
monitor the clipboard and write to file
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
#!/usr/bin/python | |
import xerox | |
import time | |
def poll_cb(): | |
cb = "" | |
cbh = "" | |
while True: | |
time.sleep(5) | |
cb = xerox.paste() | |
if cb != cbh: | |
cbh = cb | |
store(cb) | |
def store(link): | |
with open("links.txt", "a") as f: | |
f.write("%s\n" % link) | |
if __name__ == '__main__': | |
poll_cb() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment