Created
February 13, 2012 02:03
-
-
Save alloy-d/1812751 to your computer and use it in GitHub Desktop.
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
state :start do | |
transition [ | |
"need to log in", | |
"ready to post a job", | |
] | |
end | |
state "need to log in" do | |
if !body.index("log in") return false | |
transition [ | |
"log in if known", | |
"log in if unknown", | |
] | |
end | |
state "log in if known" do | |
return false unless (form = selector("form#loginKnown")) | |
# perform logic to fill in form... | |
transition [ "ready to post job" ] | |
end | |
state "log in if unknown" do | |
return false unless (form = selector("form#login")) | |
# perform logic to fill in form... | |
transition [ "ready to post job" ] | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment