Last active
December 20, 2015 04:39
-
-
Save DiegoSeC/6072523 to your computer and use it in GitHub Desktop.
Update your facebook profile with Casper
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
console.log "Magic Start Here" | |
casper = require('casper').create() | |
casper.start "http://facebook.com", -> | |
@echo "Loggin... " | |
@fill "form[id='login_form']", { email: "[email protected]", pass: "yourpassword", persistent: true }, true | |
@capture 'facebook.png' | |
casper.then -> | |
@echo 'Profile... ' | |
@capture 'profile.png' | |
casper.thenOpen "http://www.facebook.com/YourProfile?preview_cover=YourPhotoID", -> | |
@echo 'show Cover.. ' | |
html = @getHTML 'div.saveAndCancel' | |
#@echo html | |
@capture 'cover.png' | |
casper.then -> | |
@echo 'Change Cover.. ' | |
@mouseEvent 'click', 'input[name="save"]' | |
@capture 'change.png' | |
casper.then -> | |
@echo "Must Wait they Said.. " | |
casper.run -> | |
@echo("Start!").exit() | |
#Mi codigo :D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment