Created
January 1, 2012 10:40
-
-
Save youpy/1546966 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
# OSX only | |
%w/ubygems grope pit/.each {|g| require g } | |
def main | |
url = 'https://www.facebook.com/' | |
env = Grope::Env.new | |
env.load(url) | |
if env.document.title !~ /^Facebook/ | |
config = Pit.get("facebook.com", :require => { | |
'username' => 'your username in facebook', | |
'password' => 'your password in facebook' | |
}) | |
doc = env.document | |
doc.getElementById('email').value = config['username'] | |
doc.getElementById('pass').value = config['password'] | |
doc.getElementById('login_form').submit | |
env.wait(1) | |
end | |
loop do | |
env.load('https://www.facebook.com/pokes?notif_t=poke') | |
js = env.eval('return Grope') | |
env.document.querySelectorAll('a.uiIconText').each do |item| | |
if item.getAttribute('ajaxify') =~ /\/ajax\/pokes\/poke_inline\.php/ | |
js.click(item) | |
end | |
end | |
env.wait(3) | |
sleep 10 | |
end | |
end | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment