· 10 years ago · Apr 22, 2016, 01:15 AM
1# Settings
2# -------------------------------------------
3# The rest of the settings can be found in
4# script folder\settings
5active_accounts = 30 # you said you want 30 accounst all the time, to be spinned, you'll have to set this to 30
6max_consecutive_errors_before_stop = 7 # if for some reason, this number of consecutive erros occurs (couldn't create account, or do meetme, or whatever)
7sleep_after_proxy_rental_ip_change = 5 # will sleep 5 seconds after IP is changed
8# in case of error, sleep for a while to chill
9calm_things_down_delay = 5 # in seconds # if error occurs from some reason, sleep this amount of secs
10
11
12# Account creation
13# ---------------------
14create_accounts = True # if false, will do only the meetme part
15email_domains = ['gmail.com', 'yahoo.com', 'outlook.com'] # not very important, but you can put your own domains, a random one will be picked for email
16
17
18# page 2 (I think)
19# ----------------
20professions = ['worker' , 'stylist', 'banker', 'makeup', 'designer']
21headlines = ['oh hello', 'oh hye', 'lets chat', 'be a friend', 'new here', 'make me smile']
22interests = ['movies' , 'sports', 'outdoors', 'nails']
23# ----------------
24
25remove_postal_code_after_use = True # straight forward
26last_submit_button_retries = 10 # doesn't need to be changed ... it's the last button, how many times to try and click it
27 # because it's not visible from the beginning
28
29# Images
30# ------
31image_extensions = ['.jpg', '.png', '.bmp', '.jpeg'] # if you have other image extensions, put them here
32 # this is so that it won't get txt files and other BS
33image_upload_timeout = 180 # in seconds, depends on image size and proxy speed
34wait_after_click_save_image = 5 # just a double check for image upload
35
36# a random number between 1-3 in this case
37# will be picked, and that's the number of images/account
38# if you want a fixed number just put
39image_a = 1
40image_b = 3
41
42remove_image_after_upload = True # straight fwd
43# ------
44# ---------------------
45
46
47# Meet me
48# --------------
49# a random number will be picked all the time
50# and that's how many times it will click the meetme button
51# (same as image_a and image_b random choose but for meet me clicks)
52meet_me_clicks_a = 140
53meet_me_clicks_b = 180
54
55# same here, a random number (seconds) will be choosen all the time
56# will make you more stealth
57# (same as image and clicks thing)
58delay_between_meet_me_clicks_a = 4
59delay_between_meet_me_clicks_b = 8
60
61# if it cannot click the meetme button for some reason, just remove the account, and move on
62max_consecutive_meet_me_errors = 10 # it will skip the a new account (without delete)
63# --------------
64
65# Browser
66# -------
67# random user agent will be picked
68user_agents = [
69'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36',
70'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36',
71'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0',
72'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36',
73'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko',
74'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0',
75'Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0'
76]
77
78# random firefox window size will be picked
79resolutions = [
80'1280x800',
81'1024x768',
82'1012x650',
83'1043x800',
84'1000x600',
85'800x600'
86]
87# a random number will be picked after each
88# action, and also sleep(X) seconds
89# this is just really waiting after each web action (click, navigate, etc)
90# not really needed, but might be sometimes
91delay_a = 0.3 # seconds
92delay_b = 0.9 # seconds
93# -------
94
95# load timeout
96# THIS IS VERY IMPORTANT
97# if you set this to 10 for example, if the page loads more than 10 seconds
98# will return in an error, it really doesn't care
99# this is important, again, depending on your images and how fast the proxies are working
100# you know better than me about PR
101load_timeout = 200 # if it takes longer, will skip and move on
102
103disable_flash = True
104
105# firefox binary file (usually here all the time)
106firefox_binary = r"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
107
108# will clear C:\Users\YourUser\AppData\Local\Temp (the bot creates new profiles all the time,
109# and it's saving them there). This is not 100% neccessary, but I would leave it on
110clear_appdata_temp_folder = True
111clear_flash_cookies = True
112# end of settings
113# -------------------------------------------
114
115
116
117# ---------------------------
118# ! DO NOT CHANGE BELOW THIS
119# ---------------------------
120
121
122
123from selenium import webdriver
124import random
125from time import sleep
126from bs4 import BeautifulSoup as BS
127from requests import session
128import json
129import re
130import os
131import glob
132import sys
133from extra import Extra
134import socket
135from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
136import threading
137
138def remove_image(image):
139 try:
140 os.remove(image)
141 print '[+] Image removed.'
142 except:
143 print '[!] Warning: Cannot remove image: ' + image
144
145
146def get_random_name():
147 #http://api.randomuser.me/?gender=female&country=unitedstates
148 with session() as s:
149 response = s.get('http://api.randomuser.me/?gender=female&country=unitedstates')
150 data = json.loads(response.text.encode('utf-8'))
151
152 return [data['results'][0]['user']['email'], data['results'][0]['user']['username'],
153 data['results'][0]['user']['salt']]
154
155def find_input(e):
156 for i in e.find_elements_by_tag_name('input'):
157 if i.get_attribute('type') != 'hidden':
158 return i
159
160def sleep_r():
161 sleep(random.uniform(delay_a, delay_b))
162
163
164def upload_images(driver, images, do_continue = True):
165 print ''
166 print '[+] Uploading ' + str(len(images)) + ' images'
167 for image in images:
168 print '[+] Image: ' + image
169
170 rr_ = 0
171 get_out = False
172 while True:
173 if rr_ == 5:
174 get_out = True
175 break
176 try:
177 driver.find_element_by_id('FileUpload').send_keys(image)
178 break
179 except:
180 rr_ += 1
181 sleep(1)
182
183 if get_out:
184 print '[!] Element is not visibile anymore, continuing to meet me instead of throwing error'
185 break
186
187 k = 0
188 while k < image_upload_timeout:
189 try:
190 a = driver.find_element_by_id('save_link')
191 a.click()
192 print '[+] Image uploaded.'
193 if remove_image_after_upload:
194 remove_image(image)
195 sleep(wait_after_click_save_image)
196 break
197 except Exception, e:
198 pass
199 k += 1
200 sleep(1)
201
202 if k == image_upload_timeout:
203 print '[!] Upload timeout (you should increase the upload timeout). Continuing anyway'
204
205 print ''
206
207 if not do_continue:
208 return
209
210 errr = 0
211
212 while True:
213 try:
214 driver.find_element_by_class_name('cancelBtn').click()
215 print '[+] Clicked X on the image uploader.'
216 sleep(2)
217 except:
218 pass
219
220 for i in driver.find_elements_by_tag_name('input'):
221 v = i.get_attribute('value').lower()
222 if 'continue to final step' in v:
223 try:
224 i.click()
225 print '[+] Submitted.'
226 return
227 except Exception, e:
228 errr += 1
229 break
230
231 if errr == last_submit_button_retries:
232 raise Exception('Cannot submit last page.')
233
234 sleep(2)
235
236def create_account(driver, email, username, password, postal_code, images):
237 print '[+] Navigating to pof'
238 driver.get('http://pof.com')
239 if random.randint(0, 9) <= 4:
240 driver.get('http://www.pof.com/register.aspx?id=1')
241 else:
242 links = driver.find_element_by_class_name('innerbanner').find_elements_by_tag_name('a')
243 for link in links:
244 try:
245 if '/register.aspx' in link.get_attribute('href'):
246 link.click()
247 print '[+] Clicked register'
248 break
249 except:
250 pass
251
252 sleep_r()
253
254
255 email = email.replace('example.com', random.choice(email_domains))
256
257 """
258 print email
259 print username
260 print password
261 print postal_code
262 """
263
264 print '[+] Registration started'
265 main_table = driver.find_elements_by_tag_name('table')[1]
266 trs = main_table.find_elements_by_tag_name('tr')
267 trs[0].find_elements_by_tag_name('td')[1].find_element_by_class_name('title').send_keys(username)
268 trs[1].find_elements_by_tag_name('td')[1].find_element_by_class_name('title').send_keys(password)
269 trs[2].find_elements_by_tag_name('td')[1].find_element_by_class_name('title').send_keys(password)
270 trs[3].find_elements_by_tag_name('td')[1].find_element_by_class_name('title').send_keys(email)
271 trs[4].find_elements_by_tag_name('td')[1].find_element_by_class_name('title').send_keys(email)
272 trs[5].find_elements_by_tag_name('td')[1].find_elements_by_tag_name('option')[1].click()
273
274 month = random.randint(1,11)
275 day = random.randint(0,27)
276 year = 3
277
278 selects = trs[6].find_elements_by_tag_name('td')[1].find_elements_by_tag_name('select')
279
280 selects[0].find_elements_by_tag_name('option')[month].click()
281 sleep_r()
282 selects[1].find_elements_by_tag_name('option')[day].click()
283 sleep_r()
284 selects[2].find_elements_by_tag_name('option')[year].click()
285 sleep_r()
286
287 for o in trs[7].find_elements_by_tag_name('option'):
288 t = o.text.lower()
289 if t == 'united states' or t == 'caucasion':
290 o.click()
291 sleep_r()
292 break
293
294 for o in trs[8].find_elements_by_tag_name('option'):
295 t = o.text.lower()
296 if t == 'united states' or t == 'caucasion':
297 o.click()
298 sleep_r()
299 break
300
301 captcha = raw_input('[+] Type captcha: ')
302
303 for e in trs[9].find_elements_by_tag_name('input'):
304 try:
305 e.send_keys(captcha)
306 except:
307 pass
308
309 trs[10].find_element_by_tag_name('input').click()
310 sleep_r()
311
312 try:
313 trs[11].find_element_by_tag_name('input').click()
314 except:
315 pass
316
317 sleep_r()
318 driver.find_element_by_name('Submit').click()
319
320 try:
321 if 'createprofile.aspx?sguid=' not in driver.current_url:
322 raise Exception('Couldn\'t get to page 2.')
323 except Exception, e:
324 print '[!] Probably a spam check, typing captcha again and resubmitting.'
325 try:
326 c_e = driver.execute_script('return document.activeElement')
327 except:
328 try:
329 alert = driver.switch_to_alert()
330 alert.dismiss()
331 sleep_r()
332 c_e = driver.execute_script('return document.activeElement')
333 except:
334 c_e = driver.execute_script('return document.activeElement')
335 sleep_r()
336 c_e.send_keys(captcha)
337 driver.find_element_by_name('Submit').click()
338
339 if 'You are using things like > or \' etc that are not allowed' in driver.page_source:
340 raise Exception('Error from website: You are using things like > or \' etc that are not allowed.')
341
342 if 'Copy the letters displayed under the circles from the image exactly' in driver.find_element_by_tag_name('body').text:
343 raise Exception('Error from website: You\'ve typed a wrong captcha.')
344
345 try:
346 form = driver.find_element_by_tag_name('form')
347 except:
348 print '[!] Wrong captcha or spam check.'
349 print '[!] Captcha retype.'
350 driver.execute_script('return document.activeElement').send_keys(captcha)
351 driver.find_element_by_name('Submit').click()
352 sleep(2)
353 form = driver.find_element_by_tag_name('form')
354
355 print '\n[+] On page 2'
356
357 print ''
358
359 # submit second page
360 for tr in form.find_elements_by_tag_name('tr'):
361
362 tds = tr.find_elements_by_tag_name('td')
363 k = 0
364 for td in tds:
365 try:
366 text_td = td.text.lower()
367 next_td = tds[k+1]
368
369 if 'postal code/zip' in text_td:
370 find_input(tds[k+1]).send_keys(postal_code)
371 print '[+] Postal code'
372 sleep_r()
373 elif 'do you want children' in text_td:
374 next_td.find_elements_by_tag_name('option')[1].click()
375 print '[+] Do you want children'
376 sleep_r()
377 elif 'my gender' in text_td:
378 next_td.find_elements_by_tag_name('option')[1].click()
379 print '[+] My gender'
380 sleep_r()
381 elif 'marital status' in text_td:
382 next_td.find_elements_by_tag_name('option')[1].click()
383 print '[+] Marital status'
384 sleep_r()
385 elif 'seeking' in text_td:
386 next_td.find_elements_by_tag_name('option')[1].click()
387 print '[+] Seeking'
388 sleep_r()
389 elif 'do you have children' in text_td:
390 next_td.find_elements_by_tag_name('option')[2].click()
391 print '[+] Have children'
392 sleep_r()
393 elif 'height' in text_td:
394 next_td.find_elements_by_tag_name('option')[random.randint(5,8)].click()
395 print '[+] Height'
396 sleep_r()
397 elif 'do you smoke' in text_td:
398 next_td.find_elements_by_tag_name('option')[1].click()
399 print '[+] Smoke'
400 sleep_r()
401 elif 'i am looking for' in text_td:
402 next_td.find_elements_by_tag_name('option')[random.randint(1,2)].click()
403 print '[+] Looking for'
404 sleep_r()
405 elif 'do you do drugs' in text_td:
406 next_td.find_elements_by_tag_name('option')[1].click()
407 print '[+] Do drugs'
408 sleep_r()
409 elif 'hair color' in text_td:
410 l = [1, 6]
411 next_td.find_elements_by_tag_name('option')[random.choice(l)].click()
412 print '[+] Hair color'
413 sleep_r()
414 elif 'do you drink' in text_td:
415 next_td.find_elements_by_tag_name('option')[2].click()
416 print '[+] Drink'
417 sleep_r()
418 elif 'body type' in text_td:
419 next_td.find_elements_by_tag_name('option')[random.randint(1,3)].click()
420 print '[+] Body type'
421 sleep_r()
422 elif 'religion' in text_td:
423 l = [0, 1, 14]
424 next_td.find_elements_by_tag_name('option')[random.choice(l)].click()
425 print '[+] Religion'
426 sleep_r()
427 elif 'do you own a car' in text_td:
428 next_td.find_elements_by_tag_name('option')[1].click()
429 print '[+] Own a car'
430 sleep_r()
431 elif 'your profession' in text_td:
432 find_input(tds[k+1]).send_keys(random.choice(professions))
433 print '[+] Profession'
434 sleep_r()
435 elif 'education' in text_td:
436 next_td.find_elements_by_tag_name('option')[random.randint(0, 1)].click()
437 print '[+] Education'
438 sleep_r()
439 elif 'do you have pets' in text_td:
440 next_td.find_elements_by_tag_name('option')[0].click()
441 print '[+] Pets'
442 elif 'eye color' in text_td:
443 l = [1, 4]
444 next_td.find_elements_by_tag_name('option')[random.choice(l)].click()
445 print '[+] Eye color'
446 elif 'personality in one word' in text_td:
447 opts = next_td.find_elements_by_tag_name('option')
448 i = random.randint(1, len(opts)-1)
449 opts[i].click()
450 print '[+] Personality'
451 sleep_r()
452 elif 'second language' in text_td:
453 next_td.find_elements_by_tag_name('option')[0].click()
454 print '[+] Second language'
455 sleep_r()
456 elif 'not ambitious' in text_td and 'very ambitious' in text_td:
457 opts_ = td.find_elements_by_tag_name('option')
458 opts_[random.randint(3,4)].click()
459 sleep_r()
460
461
462 elif 'it comes to dating what best describes your intent' in text_td:
463 td.find_elements_by_tag_name('option')[2].click()
464 print '[+] Dating intents'
465 sleep_r()
466 elif 'longest relationship you have been in' in text_td:
467 td.find_elements_by_tag_name('option')[random.randint(2,5)].click()
468 print '[+] Longest relationship'
469 sleep_r()
470 elif 'income' in text_td:
471 td.find_elements_by_tag_name('option')[random.randint(1,7)].click()
472 print '[+] Income'
473 sleep_r()
474 elif 'birth father and mother are' in text_td:
475 td.find_elements_by_tag_name('select')[0].find_elements_by_tag_name('option')[random.randint(1,6)].click()
476 sleep_r()
477 td.find_elements_by_tag_name('select')[1].find_elements_by_tag_name('option')[random.randint(1,3)].click()
478 sleep_r()
479 td.find_elements_by_tag_name('select')[2].find_elements_by_tag_name('option')[1].click()
480 print '[+] Family'
481 sleep_r()
482 elif 'you date someone who has kids' in text_td:
483 td.find_elements_by_tag_name('option')[2].click()
484 print '[+] Someone who has kids'
485 sleep_r()
486 elif 'date someone who smokes' in text_td:
487 td.find_elements_by_tag_name('option')[2].click()
488 print '[+] Someone who smokes'
489 sleep_r()
490 elif 'few extra pounds selected as a body type' in text_td:
491 td.find_elements_by_tag_name('option')[1].click()
492 print '[+] Someone with extra pounds'
493 sleep_r()
494 k += 1
495 except Exception, e:
496 pass
497
498
499 # part 2
500 print ''
501
502 for select in form.find_elements_by_tag_name('select'):
503 os = select.find_elements_by_tag_name('option')
504 select_text = select.text.lower()
505 if 'i want to date but nothing serious' in select_text and 'i am putting in serious' in select_text:
506 os[2].click()
507 print '[+] Intent'
508 sleep_r()
509 elif 'over 10 years' in select_text and 'over 1 year' in select_text:
510 os[random.randint(2,5)].click()
511 print '[+] Longest relationship'
512 sleep_r()
513 elif '150,000+' in select_text and 'less than 25,000' in select_text:
514 os[random.randint(1, len(os)-1)].click()
515 print '[+] Cash'
516 sleep_r()
517 elif 'still married' in select_text and 'one has passed away' in select_text:
518 os[random.randint(1,6)].click()
519 print '[+] Parents relationship'
520 sleep_r()
521 elif '1 child' in select_text and '9 children' in select_text:
522 os[random.randint(1,9)].click()
523 print '[+] Parents children'
524 sleep_r()
525 elif 'the oldest' in select_text and 'seventh born' in select_text:
526 os[1].click()
527 print '[+] Oldest one'
528 sleep_r()
529 elif 'i only date single parents' in select_text:
530 os[2].click()
531 print '[+] Date parents'
532 sleep_r()
533 elif 'i only date smokers' in select_text:
534 os[2].click()
535 print '[+] Date smokers'
536 sleep_r()
537 elif 'i only date a few extra pounds' in select_text:
538 os[1].click()
539 print '[+] Date extra pounds'
540 sleep_r()
541
542
543 driver.find_element_by_id('headline').send_keys(random.choice(headlines).strip())
544 print '[+] Headline'
545 sleep_r()
546 driver.find_element_by_id('interests').send_keys(random.choice(interests).strip())
547 print '[+] Interests'
548 sleep_r()
549
550 # textareas (only 2)
551 text_areas = driver.find_elements_by_tag_name('textarea')
552 text_areas[0].send_keys(get_description().strip())
553 print '[+] Description'
554 sleep_r()
555 text_areas[1].send_keys(get_first_date().strip())
556 print '[+] First date'
557 sleep_r()
558
559 print ''
560
561 # submit page 2
562 for i in driver.find_elements_by_tag_name('input'):
563 v = i.get_attribute('value')
564 if 'create my profile now!' in v.strip().lower():
565 print '[+] Submiting.'
566 i.click()
567 sleep_r()
568 break
569
570 if 'createProfileSuccess=True' not in driver.current_url:
571 raise Exception('Not sure page submitted.')
572
573 upload_images(driver, images)
574 sleep_r()
575
576 if 'poftest.aspx' in driver.current_url:
577 return
578
579 if 'log out' not in driver.page_source.lower():
580 raise Exception('Not sure if account got created, trying again.')
581
582def get_random(arr):
583 return arr[random.randrange(0,len(arr))]
584def _select(m):
585 choices = m.group(1).split('|')
586 return choices[random.randint(0, len(choices)-1)]
587def spin(text, tokens=None):
588 r = re.compile('{([^{}]*)}')
589 while True:
590 text, n = r.subn(_select, text)
591 if n == 0:
592 break
593 if tokens:
594 text = multi_replace(text, tokens)
595 return text.strip()
596
597
598def read_file(f):
599 s = ''
600 with open(f, 'rb') as g:
601 s = g.read()
602 return s
603
604def get_accounts():
605 l = []
606 for line in open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'accounts.txt'), 'rb'):
607 s = line.split('::')
608 g = []
609 g.append(s[0].strip())
610 g.append(s[1].strip())
611 l.append(g)
612 return l
613
614def remove_account(email, show_text=True):
615 l = []
616 for line in open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'accounts.txt'), 'rb'):
617 if email != line.split('::')[0].strip():
618 l.append(line)
619 with open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'accounts.txt'),'wb') as f:
620 for e in l:
621 f.write(e.strip()+'\n')
622
623 if show_text:
624 print '[+] Account removed: ' + email
625
626def get_newest_account():
627 l = []
628 for line in open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'accounts.txt'),'rb'):
629 l.append(line.strip())
630 return l[0]
631
632def get_oldest_account():
633 l = []
634 for line in open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'accounts.txt'),'rb'):
635 l.append(line.strip())
636 return l[-1]
637
638def add_account(email, password, end=True):
639 l = []
640 for line in open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'accounts.txt'), 'rb'):
641 if email != line.split('::')[0].strip():
642 l.append(line.strip())
643
644 with open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'accounts.txt'), 'wb') as f:
645 if not end:
646 for e in l:
647 f.write(e+'\n')
648 f.write(email + '::' + password + '\n')
649 else:
650 f.write(email + '::' + password + '\n')
651 for e in l:
652 f.write(e+'\n')
653
654def get_images():
655 n = random.randint(image_a, image_b)
656 real_m = []
657 imgs = glob.glob(os.path.join(os.path.join(os.path.join(os.getcwd(), 'settings'), 'pictures'), '*'))
658 for e in imgs:
659 ok = False
660 for ex in image_extensions:
661 if e.endswith(ex.lower()):
662 ok = True
663 if ok:
664 real_m.append(e)
665 random.shuffle(real_m)
666 return real_m[:n]
667
668def get_description():
669 return spin(read_file(os.path.join(os.path.join(os.getcwd(), 'settings'), 'description.txt')))
670
671def get_first_date():
672 return spin(read_file(os.path.join(os.path.join(os.getcwd(), 'settings'), 'first_date.txt')))
673
674def get_postal_code():
675 l = []
676 for line in open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'postal_codes.txt'), 'rb'):
677 l.append(line.strip())
678
679 try:
680 postal_code = random.choice(l)
681 except:
682 raise Exception('Out of postal codes. Check posta_codes.txt, it\'s probably empty.')
683
684 if remove_postal_code_after_use:
685 l.remove(postal_code)
686 with open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'postal_codes.txt'), 'wb') as f:
687 for e in l:
688 f.write(e + '\n')
689
690 return postal_code
691
692def proxy_rental():
693 print '[+] Closing all firefox instances and changing proxy rental IP.'
694 Extra.close_all_ff_instances()
695 Extra.change_proxy_rental_ip()
696 print '[+] Sleeping for ' + str(sleep_after_proxy_rental_ip_change) + ' seconds.'
697 sleep(sleep_after_proxy_rental_ip_change)
698
699def do_account_create(driver):
700 postal_code = get_postal_code()
701 images = get_images()
702 if len(images) == 0:
703 print '[!] No images available.'
704 print '[!] Will try to do meetme instead.'
705 do_meet_me(driver)
706 return
707 sys.stdout.write('[+] Getting new identity - ')
708 sys.stdout.flush()
709
710 try:
711 email, username, password = get_random_name()
712 print 'OK'
713 except Exception, e:
714 print 'FAILED'
715 raise Exception('Cannot get identity.')
716
717 try:
718 create_account(driver, email, username, password, postal_code, images)
719 print '[+] Account created: ' + username
720 add_account(username, password, True)
721 #a = raw_input('account addded')
722 except Exception, e:
723 print str(e)
724 raise Exception('Cannot create account.')
725
726def images_not_there(driver):
727 try:
728 s= driver.find_element_by_id('imageitembox').get_attribute('class')
729 return False
730 except:
731 return True
732
733def meet_me(driver, username, password, clicks_to_send, do_not_login):
734 if not do_not_login:
735 print ''
736 print '[+] Logging in.'
737 lgn_links = ['http://www.pof.com/inbox.aspx', 'http://www.pof.com/meetme.aspx', 'http://www.pof.com']
738
739 if random.randint(0, 9) <= 4:
740 driver.get(random.choice(lgn_links))
741 else:
742 driver.get(random.choice(lgn_links))
743 links = None
744 try:
745 links = driver.find_element_by_class_name('innerbanner').find_elements_by_tag_name('a')
746 except:
747 sleep(5)
748 links = driver.find_element_by_class_name('innerbanner').find_elements_by_tag_name('a')
749 for link in links:
750 try:
751 if '/meetme.aspx' in link.get_attribute('href'):
752 link.click()
753 break
754 except:
755 pass
756
757
758 sleep_r()
759
760 driver.find_element_by_id('logincontrol_username').send_keys(username)
761 sleep_r()
762 pass_field = driver.find_element_by_id('logincontrol_password')
763 pass_field.send_keys(password)
764 sleep_r()
765 pass_field.submit()
766 sleep_r()
767 if 'log out' in driver.page_source.lower():
768 print '[+] Logged in.'
769 else:
770 remove_account(username)
771 raise Exception('Cannot login.')
772
773 sleep(random.randint(1,4))
774
775 print '[+] Checking if the images are still up.'
776
777
778 if 'inbox.aspx' in driver.current_url:
779 if 'you have no images.' in driver.page_source.lower():
780 print '[+] Looks like your images got deleted, uploading new images.'
781 print '[+] Getting on the images page.'
782 driver.get('http://www.pof.com/images.aspx')
783 imgs_ = get_images()
784 if len(imgs) == 0:
785 print '[!] No images available, doing meetme.'
786 else:
787 upload_images(driver, imgs_, False)
788 else:
789 print '[+] Images still there.'
790 elif 'images.aspx' in driver.current_url:
791 if images_not_there(driver):
792 print '[+] Looks like your images got deleted, uploading new images.'
793 upload_images(driver, get_images(), False)
794 else:
795 print '[+] Images still there.'
796 else:
797 print '[+] Navigating to the right page'
798 driver.get('http://www.pof.com/images.aspx')
799 if images_not_there(driver):
800 print '[+] Looks like your images got deleted, uploading new images.'
801 upload_images(driver, get_images(), False)
802 else:
803 print '[+] Images still there.'
804
805
806
807 if 'loginError=1' in driver.current_url:
808 remove_account(username)
809 raise Exception('[!] Error from website: found loginError=1 in link, account probably banned.')
810
811 if 'log out' not in driver.page_source.lower():
812 remove_account(username)
813 raise Exception('[!] Error from website: annot find log out in page, account probably banned.')
814
815
816 k = 0
817 err = 0
818 first = False
819 while k < clicks_to_send:
820 try:
821 if 'meetme.aspx' not in driver.current_url:
822 print '[+] Navigating to meetme page.'
823 driver.get('http://www.pof.com/meetme.aspx')
824 sleep_r()
825 driver.find_element_by_name('votea').click()
826 if not first:
827 print '[+] First click got through.'
828 first = True
829 sleep(random.randint(delay_between_meet_me_clicks_a, delay_between_meet_me_clicks_b))
830 sleep_r()
831 k += 1
832 err = 0
833 except:
834 print '[!] Couldn\'t click Yes, retrying.'
835 driver.get('http://pof.com/meetme.aspx')
836 err += 1
837
838 if err == max_consecutive_meet_me_errors:
839 if k == 0:
840 remove_account(username)
841 raise Exception('Got maximum consecutive meetme errors, skipping account.')
842
843 if k % 5 == 0:
844 print '[+] Clicked Yes ' + str(k) + ' times'
845
846 remove_account(username, False)
847 add_account(username, password)
848 print '[+] Meetme clicks sent.'
849
850def do_meet_me(driver, use_newest=False):
851 acc = ''
852
853 if not use_newest:
854 acc = get_oldest_account()
855 else:
856 acc = get_newest_account()
857
858 username = acc.split('::')[0]
859 password = acc.split('::')[1]
860
861 print ''
862 print '[+] Meetme: ' + username
863 clicks_to_send = random.randint(meet_me_clicks_a, meet_me_clicks_b)
864 print '[+] Clicking Yes ' + str(clicks_to_send) + ' times'
865
866 try:
867 meet_me(driver, username, password, clicks_to_send, use_newest)
868 except Exception, e:
869 print str(e)
870 raise Exception('Cannot do meetme.')
871
872def close_browser(driver):
873 try:
874 driver.quit()
875 except:
876 pass
877
878def start_browser_check():
879 a = Extra.get_temp_file()
880 with open(a, 'wb') as f:
881 f.write('')
882
883 t = threading.Thread(target=Extra.check_browser)
884 t.start()
885
886def get_new_browser():
887 ua = random.choice(user_agents)
888 wsize = random.choice(resolutions)
889 wsize = wsize.lower()
890 w = wsize.split('x')[0]
891 h = wsize.split('x')[1]
892
893 profile = webdriver.FirefoxProfile()
894 profile.set_preference("general.useragent.override",ua)
895 if disable_flash:
896 profile.set_preference('dom.ipc.plugins.enabled.libflashplayer.so', 'false')
897 print '[+] Flash disabled.'
898 binary = FirefoxBinary(firefox_binary)
899 start_browser_check()
900 driver = webdriver.Firefox(firefox_profile=profile, firefox_binary=binary)
901 driver.set_window_size(w, h)
902 Extra.remove_file(Extra.get_temp_file())
903 return driver
904def do_clean():
905 try:
906 Extra.clear_temp_folder()
907 print '[+] Temp folder cleaned.'
908 except:
909 print '[!] Cannot clear temp folder.'
910
911
912def clear_flash_cks():
913 try:
914 Extra.clear_flash()
915 print '[+] Flash cookies cleared.'
916 except:
917 print '[!] Cannot clear flash cookies.'
918
919def main():
920 print '[+] POF automation'
921 print '[+] getyourbots.com'
922 print ''
923
924 # init variables
925 socket.setdefaulttimeout(load_timeout)
926
927 accounts = []
928 try:
929 accounts = get_accounts()
930 except Exception, e:
931 with open(os.path.join(os.path.join(os.getcwd(), 'settings'), 'accounts.txt'), 'wb') as f:
932 f.write('')
933 print '[!] Accounts didn\'t exist, just created it.'
934
935 print '[+] Accounts in database: ' + str(len(accounts))
936 print '[+] Make sure ProxyRental is started, you\'re logged in, and connected. The software will change the IP automatically when needed.'
937 print ''
938 a = raw_input('[-] If everything is set, press any key to continue ...')
939 print ''
940 runs = 0
941 errs = 0
942
943 while True:
944 if clear_appdata_temp_folder:
945 do_clean()
946 if clear_flash_cookies:
947 clear_flash_cks()
948 accounts = get_accounts()
949 proxy_rental()
950 print ''
951 if len(accounts) < active_accounts and create_accounts:
952 print ''
953 print '[+] You have ' + str(len(accounts)) + ' accounts in the DB.'
954 print '[+] Your active accounts variable is set to: ' + str(active_accounts)
955 print '[+] Creating new account'
956 print ''
957 print '[+] Starting browser'
958 driver = None
959 try:
960 driver = get_new_browser()
961 do_account_create(driver)
962 do_meet_me(driver, True)
963 close_browser(driver)
964 errs = 0
965
966 runs += 1
967 print '---------------------------------------------------------'
968 print '[+] Ran ' + str(runs) + ' times'
969 print '---------------------------------------------------------'
970 continue
971 except Exception, e:
972 close_browser(driver)
973 errs += 1
974 print '[!] Error: ' + str(e)
975 print '[!] Sleeping for ' + str(calm_things_down_delay) + ' seconds to calm things down ...'
976 sleep(calm_things_down_delay)
977
978 runs += 1
979 print '---------------------------------------------------------'
980 print '[+] Ran ' + str(runs) + ' times'
981 print '---------------------------------------------------------'
982 continue
983
984 print '[+] Starting browser'
985 driver = None
986 try:
987 driver = get_new_browser()
988 do_meet_me(driver)
989 close_browser(driver)
990 runs += 1
991 print '---------------------------------------------------------'
992 print '[+] Ran ' + str(runs) + ' times'
993 print '---------------------------------------------------------'
994
995 continue
996 except Exception, e:
997 close_browser(driver)
998 errs += 1
999 print '[!] Error: ' + str(e)
1000 print '[!] Sleeping for ' + str(calm_things_down_delay) + ' seconds to calm things down ...'
1001 sleep(calm_things_down_delay)
1002
1003 runs += 1
1004 print '---------------------------------------------------------'
1005 print '[+] Ran ' + str(runs) + ' times'
1006 print '---------------------------------------------------------'
1007
1008 continue
1009
1010
1011
1012 if errs == max_consecutive_errors_before_stop:
1013 print '[+] Got to maximum consecutive errors. Stopping.'
1014 a = raw_input()
1015 sys.exit()
1016
1017 runs += 1
1018 print '---------------------------------------------------------'
1019 print '[+] Ran ' + str(runs) + ' times'
1020 print '---------------------------------------------------------'
1021
1022
1023 #create_account(driver, email, username, password, postal_code, images)
1024
1025
1026if __name__ == "__main__":
1027 main()