forked from linuz/Facebook-Auto-Poker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFacebookAuto-Poker.py
41 lines (41 loc) · 1.53 KB
/
FacebookAuto-Poker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /usr/bin/python
#############################################################################
# Facebook Auto-Poker Python V1.5 #
# Written By: Dennis Linuz <[email protected]> #
# Auto-pokes anyone on Facebook that has poked you with a Variable Delay #
# and a file to specify which Facebook IDs NOT to poke (blockPokes.txt) #
#############################################################################
FACEBOOK_USERNAME = ""
FACEBOOK_PASSWORD = ""
import mechanize, time, os
MAX_DELAY = 60
delay = MAX_DELAY
totalPokes = 0
browser = mechanize.Browser()
browser.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.61')]
browser.set_handle_robots(False)
browser.open("http://m.facebook.com/pokes")
browser._factory.is_html = True
browser.select_form(nr=0)
browser.form['email'] = FACEBOOK_USERNAME
browser.form['pass'] = FACEBOOK_PASSWORD
browser.submit()
browser._factory.is_html = True
while True:
try:
tempPokeCount = 0
browser.open("http://m.facebook.com/pokes")
browser._factory.is_html = True
for l in browser.links(text_regex="Poke back"):
result = True
browser._factory.is_html = True
if result:
browser.follow_link(text_regex="Poke back",nr=0)
tempPokeCount += 1
totalPokes += 1
print "Poked! Total Pokes: " + str(totalPokes) + "\n"
if (tempPokeCount != 0 and delay > 1): delay /= 2
if (tempPokeCount == 0 and delay < MAX_DELAY): delay *= 2
except:
print "There was some sort of error :("
time.sleep(delay)