Skip to content

Instantly share code, notes, and snippets.

@DiegoSeC
Last active December 20, 2015 04:39
Show Gist options
  • Save DiegoSeC/6072523 to your computer and use it in GitHub Desktop.
Save DiegoSeC/6072523 to your computer and use it in GitHub Desktop.
Update your facebook profile with Casper
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