from subprocess import * import re import SendKeys # First we're going to open up a Google Chrome window # Navigate to our target # and copy the URL to the clipboard # The F11 command full-screens the window, ensuring that # we dont end up just tabbing through the navigation # For safety and best practices, always close a window when # you're done with it SendKeys.SendKeys(""" {LWIN} {PAUSE .25} chrome{ENTER} {PAUSE 1} {F6}http://www.facebook.com{ENTER} {PAUSE 3} {F11}{TAB 2} David{SPACE}Kim{ENTER} {PAUSE 3}{F11} {F6}^c %{F4} """) # Next we're going to open up notepad and copy the clipboard # into the window # We'll then save it to the same location we started the # python script from SendKeys.SendKeys(""" {LWIN} {PAUSE .25} notepad{ENTER} {PAUSE 1} ^v ^s {PAUSE 1} C:\Users\jamal.mahboob\Desktop{\}target.txt{ENTER} {PAUSE 1} %{F4} """) # Now we can read this file and mess with the string in pure code link = open("target.txt",'r').readline() link = link.split('/') print link # If the user has selected not selected a facebook name, use their UID # which we need to parse out if link[3].find('=') != -1: link = link[3].split('=') link = link[1] # Otherwise, we can just use their selected name else: link = link[3] print link # We can then open a new chrome window and navigate to the # messages subdirectory with our target name/UID # When this window loads (as of this writing, Dec 13 2011) # it will automatically place the cursor in the text field SendKeys.SendKeys(""" {LWIN} {PAUSE .25} chrome{ENTER} {PAUSE 3} {F6} http://www.facebook.com/messages/""" + link + """ {ENTER} {PAUSE 3} Bwahahah{ENTER} """) while True: SendKeys.SendKeys(""" {PAUSE 1} Boner{ENTER} """) # We can then loop it and bug the SHIT out of Laurino