Advertisement
Guest User

FFXU Spam Bumping Script

a guest
Nov 24th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 15.40 KB | None | 0 0
  1. import numpy
  2. import time
  3. from selenium import webdriver
  4.  
  5. cell_data = numpy.zeros(shape=(205,7), dtype = "<U120")
  6. cell_data2 = numpy.zeros(shape=(205,7), dtype = "<U120")
  7. cell_data3 = numpy.zeros(shape=(205,7), dtype = "<U120")
  8. browser = webdriver.Chrome('c:\\Users\\lenovo\\desktop\\chromedriver')
  9. row_count = 0
  10. row_count2 = 0
  11. row_count3 = 0
  12. url_count = 1
  13. url_count2 = 1
  14. url_count3 = 1
  15. spam_count = 0
  16. spam_count2 = 0
  17. spam_count3 = 0
  18. passcode = ""
  19. bad_words = ["BUY", "ONLINE", "Sticky:", "Pharmacy", "EARN CASH", "shop", "MEDS", "puppy", "Tramadol", "Beagles","Remove warts","for sale","Essay service","buy","Buy"]
  20. dictionary_key = numpy.array(['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'], dtype=numpy.str)
  21. dictionary = numpy.array(['a',
  22.                      '******** **     ****     ********** **     ****     ********** ',
  23.                      ' ****** **    ****      **      **      **    ** ****** ',
  24.                      '******** **     ****     ****     ****     ****     ********** ',
  25.                      '**********      **      ******  **      **      ********',
  26.                      '**********      **      ******  **      **      **      ',
  27.                      ' ******  **    ** **       **   ******    ** **    **  ******  ',
  28.                      '**     ****     ****     *************     ****     ****     **',
  29.                      'i',
  30.                      '      **      **      **      ****    ****    ** ****** ',
  31.                      '**    ****   ** **  **  *****   **  **  **   ** **    **',
  32.                      '**      **      **      **      **      **      ********',
  33.                      '**     *****   ******* ****** *** ****     ****     ****     **',
  34.                      '**    *****   ******  **** ** ****  ******   *****    **',
  35.                      'o',
  36.                      '******** **     ****     ********** **       **       **       ',
  37.                      'q',
  38.                      'r',
  39.                      's',
  40.                      '********   **      **      **      **      **      **   ',
  41.                      '**     ****     ****     ****     ****     ****     ** ******* ',
  42.                      '**     ****     ****     ****     ** **   **   ** **     ***   ',
  43.                      '**      ****  **  ****  **  ****  **  ****  **  ****  **  ** ***  *** ',
  44.                      '**     ** **   **   ** **     ***     ** **   **   ** **     **',
  45.                      '**    ** **  **   ****     **      **      **      **   ',
  46.                      'z',
  47.                      '0',
  48.                      '1',
  49.                      '2',
  50.                      ' ******* **     **       ** *******        ****     ** ******* ',
  51.                      '**       **    ** **    ** **    ** *********      **       ** ',
  52.                      '5',
  53.                      ' ******* **     ****       ******** **     ****     ** ******* ',
  54.                      '**********    **    **     **     **      **      **    ',
  55.                      '8',
  56.                      ' ******* **     ****     ** ********       ****     ** ******* '], dtype=numpy.str)
  57.  
  58. def get_page_1():
  59.     global browser
  60.     global cell_data
  61.     global row_count
  62.     global url_count
  63.     browser.get('http://www.fairfaxunderground.com/forum/list/2.html')
  64.     content = browser.find_element_by_class_name('PhorumStdTable')
  65.     my_rows = content.find_elements_by_tag_name('tr')
  66.  
  67.     for i in my_rows:
  68.         my_columns = i.find_elements_by_tag_name('td')
  69.         k = 0
  70.         for m in my_columns:
  71.             cell_data[row_count][k] = m.get_attribute('innerText')
  72.             k = k + 1
  73.         row_count = row_count + 1
  74.     print("Page 1 size: ", content.size)
  75.  
  76.     # gets urls and determine is url link is to thread or a profile, email, etc
  77.     # then send urls to matrix with other 5 forms data
  78.     my_urls = browser.find_elements_by_xpath("//table[@class = 'PhorumStdTable']//td/a")
  79.  
  80.     partial_string = "read"
  81.     for z in my_urls:
  82.         if partial_string in z.get_attribute("href"):
  83.             cell_data[url_count][5] = z.get_attribute("href")
  84.             url_count = url_count + 1
  85.  
  86.  
  87. def get_page_2():
  88.     global browser
  89.     global cell_data2
  90.     global row_count2
  91.     global url_count2
  92.  
  93.     browser.get('http://www.fairfaxunderground.com/forum/list/2/page-2.html')
  94.     content = browser.find_element_by_class_name('PhorumStdTable')
  95.     my_rows = content.find_elements_by_tag_name('tr')
  96.  
  97.     for i in my_rows:
  98.         my_columns = i.find_elements_by_tag_name('td')
  99.         k = 0
  100.         for m in my_columns:
  101.             cell_data2[row_count2][k] = m.get_attribute('innerText')
  102.             k = k + 1
  103.         row_count2 = row_count2 + 1
  104.     print("Page 2 size: ", content.size)
  105.  
  106.     # get urls and determine is url link is to thread or a profile, email, etc
  107.     # then send urls to matrix with other 5 forms data
  108.     my_urls2 = browser.find_elements_by_xpath("//table[@class = 'PhorumStdTable']//td/a")
  109.  
  110.     partial_string = "read"
  111.  
  112.     for z in my_urls2:
  113.         if partial_string in z.get_attribute("href"):
  114.             cell_data2[url_count2][5] = z.get_attribute("href")
  115.             url_count2 = url_count2 + 1
  116.  
  117. def get_page_3():
  118.     global browser
  119.     global cell_data3
  120.     global row_count3
  121.     global url_count3
  122.  
  123.     browser.get('http://www.fairfaxunderground.com/forum/list/2/page-3.html')
  124.     content = browser.find_element_by_class_name('PhorumStdTable')
  125.     my_rows = content.find_elements_by_tag_name('tr')
  126.  
  127.     for i in my_rows:
  128.         my_columns = i.find_elements_by_tag_name('td')
  129.         k = 0
  130.         for m in my_columns:
  131.             cell_data3[row_count3][k] = m.get_attribute('innerText')
  132.             k = k + 1
  133.         row_count3 = row_count3 + 1
  134.     print("Page 3 size: ", content.size)
  135.  
  136.     # get urls and determine is url link is to thread or a profile, email, etc
  137.     # then send urls to matrix with other 5 forms data
  138.     my_urls3 = browser.find_elements_by_xpath("//table[@class = 'PhorumStdTable']//td/a")
  139.  
  140.     partial_string = "read"
  141.  
  142.     for z in my_urls3:
  143.         if partial_string in z.get_attribute("href"):
  144.             cell_data3[url_count3][5] = z.get_attribute("href")
  145.             url_count3 = url_count3 + 1
  146.  
  147. def determine_spam():
  148.     global cell_data
  149.     global spam_count
  150.     global bad_words
  151.     t = 0
  152.     for m in cell_data:
  153.         if any(x in cell_data[t][0] for x in bad_words):
  154.             cell_data[t][6] = "SPAM"
  155.             spam_count = spam_count + 1
  156.         t = t + 1
  157.  
  158. def determine_spam2():
  159.     global cell_data2
  160.     global spam_count2
  161.     global bad_words
  162.  
  163.     t = 0
  164.     for m in cell_data2:
  165.         if any(x in cell_data2[t][0] for x in bad_words):
  166.             cell_data2[t][6] = "SPAM"
  167.             spam_count2 = spam_count2 + 1
  168.         t = t + 1
  169.  
  170. def determine_spam3():
  171.     global cell_data3
  172.     global spam_count3
  173.     global bad_words
  174.     t = 0
  175.     for m in cell_data3:
  176.         if any(x in cell_data3[t][0] for x in bad_words):
  177.             cell_data3[t][6] = "SPAM"
  178.             spam_count3 = spam_count3 + 1
  179.         t = t + 1
  180.  
  181. def print_all_rows():
  182.     global cell_data
  183.     global cell_data2
  184.     global cell_data3
  185.     r = 0
  186.     for y in cell_data:
  187.         if cell_data[r][0] != "":
  188.             print(r, " ", cell_data[r][0],cell_data[r][1],cell_data[r][2],cell_data[r][3],cell_data[r][4],cell_data[r][5],cell_data[r][6])
  189.         r = r + 1
  190.     r = 0
  191.     for y in cell_data2:
  192.         if cell_data2[r][0] != "":
  193.             print(r, " ", cell_data2[r][0],cell_data2[r][1],cell_data2[r][2],cell_data2[r][3],cell_data2[r][4],cell_data2[r][5],cell_data2[r][6])
  194.         r = r + 1
  195.     r = 0
  196.     for y in cell_data3:
  197.         if cell_data3[r][0] != "":
  198.             print(r, " ", cell_data3[r][0],cell_data3[r][1],cell_data3[r][2],cell_data3[r][3],cell_data3[r][4],cell_data3[r][5],cell_data3[r][6])
  199.         r = r + 1
  200.  
  201. def bump_thread():
  202.     global cell_data
  203.     global cell_data2
  204.     global cell_data3
  205.     global browser
  206.     global passcode
  207.  
  208.     r = 102
  209.     while(r>0):
  210.     #for i in cell_data:
  211.         if (cell_data3[r][6] == "" and cell_data3[r][0] != ""):
  212.             print(cell_data3[r][5])
  213.             browser.get(cell_data3[r][5])
  214.             print(r, cell_data3[r][0], cell_data3[r][3], cell_data3[r][5], cell_data3[r][6])
  215.             decode_letters()
  216.             time.sleep(1)
  217.             passcode_form = browser.find_element_by_id('spamhurdles_captcha_answer_input')
  218.             passcode_form.send_keys(passcode)
  219.             passcode_form.submit()
  220.             time.sleep(.5)
  221.             author_form = browser.find_element_by_xpath("//table[@class='PhorumFormTable']//input[@name='author']")
  222.             author_form.send_keys(passcode)
  223.             author_form.submit()
  224.             time.sleep(.5)
  225.             subject_form = browser.find_element_by_id('phorum_textarea')
  226.             subject_form.send_keys('.')
  227.             subject_form.submit()
  228.             time.sleep(.5)
  229.             submit_button = browser.find_element_by_name('finish')
  230.             time.sleep(3)
  231.             submit_button.click()
  232.             #time.sleep(2)
  233.         r = r - 1
  234.  
  235.     r = 102
  236.     while(r>0):
  237.     #for i in cell_data:
  238.         if (cell_data2[r][6] == "" and cell_data2[r][0] != ""):
  239.             browser.get(cell_data2[r][5])
  240.             print(r, cell_data2[r][0], cell_data2[r][3], cell_data2[r][5], cell_data2[r][6])
  241.             decode_letters()
  242.             time.sleep(1)
  243.             passcode_form = browser.find_element_by_id('spamhurdles_captcha_answer_input')
  244.             passcode_form.send_keys(passcode)
  245.             passcode_form.submit()
  246.             time.sleep(.5)
  247.             author_form = browser.find_element_by_xpath("//table[@class='PhorumFormTable']//input[@name='author']")
  248.             author_form.send_keys(passcode)
  249.             author_form.submit()
  250.             time.sleep(.5)
  251.             subject_form = browser.find_element_by_id('phorum_textarea')
  252.             subject_form.send_keys('.')
  253.             subject_form.submit()
  254.             time.sleep(.5)
  255.             submit_button = browser.find_element_by_name('finish')
  256.             time.sleep(3)
  257.             submit_button.click()
  258.             #time.sleep(2)
  259.         r = r - 1
  260.  
  261.  
  262.     r = 102
  263.     while(r>0):
  264.     #for i in cell_data:
  265.         if (cell_data[r][6] == "" and cell_data[r][0] != ""):
  266.             browser.get(cell_data[r][5])
  267.             print(r, cell_data[r][0], cell_data[r][3], cell_data[r][5], cell_data[r][6])
  268.             decode_letters()
  269.             time.sleep(1)
  270.             passcode_form = browser.find_element_by_id('spamhurdles_captcha_answer_input')
  271.             passcode_form.send_keys(passcode)
  272.             passcode_form.submit()
  273.             time.sleep(.5)
  274.             author_form = browser.find_element_by_xpath("//table[@class='PhorumFormTable']//input[@name='author']")
  275.             author_form.send_keys(passcode)
  276.             author_form.submit()
  277.             time.sleep(.5)
  278.             subject_form = browser.find_element_by_id('phorum_textarea')
  279.             subject_form.send_keys('.')
  280.             subject_form.submit()
  281.             time.sleep(.5)
  282.             submit_button = browser.find_element_by_name('finish')
  283.             time.sleep(3)
  284.             submit_button.click()
  285.             #time.sleep(2)
  286.         r = r - 1
  287.  
  288. def decode_letters():
  289.     global dictionary
  290.     global dictionary_key
  291.     global browser
  292.     global passcode
  293.  
  294.     f = 1
  295.     while(f>0):
  296.  
  297.         t1 = browser.find_elements_by_id('spamhurdles_captcha_asciiart')
  298.         for i in t1:
  299.             #print(i.get_attribute('innerText'))
  300.             my_letters = i.get_attribute('innerText')
  301.         f = f - 1
  302.     blah = my_letters.splitlines()
  303.     ls = numpy.zeros(shape=(7, 60), dtype="<U1") #7x60 matrix to hold ascii art of 5 letters
  304.     w = 0
  305.     for z in blah[0]:
  306.         ls[0][w] = z
  307.         w = w + 1
  308.     w = 0
  309.     for z in blah[1]:
  310.         ls[1][w] = z
  311.         w = w + 1
  312.     w = 0
  313.     for z in blah[2]:
  314.         ls[2][w] = z
  315.         w = w + 1
  316.     w = 0
  317.     for z in blah[3]:
  318.         ls[3][w] = z
  319.         w = w + 1
  320.     w = 0
  321.     for z in blah[4]:
  322.         ls[4][w] = z
  323.         w = w + 1
  324.     w = 0
  325.     for z in blah[5]:
  326.         ls[5][w] = z
  327.         w = w + 1
  328.     w = 0
  329.     for z in blah[6]:
  330.         ls[6][w] = z
  331.         w = w + 1
  332.     #determine break lines bp[0] - bp[9] between letters
  333.     #6 different regions. 1 on each side of 1 width
  334.     #4 in between letters of 2 width
  335.     w = 0
  336.     #bp = numpy.zeros(shape=(10, 1), dtype = "uint8") #breakpoints between letters, number represents column # in ls array
  337.     bp = numpy.array([0,0,0,0,0,0,0,0,0,0], dtype=numpy.uint8)
  338.     c = 0
  339.     while(w<60):
  340.         if(ls[0][w] == " " and ls[1][w] == " " and ls[2][w] == " " and ls[3][w] == " " and ls[4][w] == " " and ls[5][w] == " " and ls[6][w] == " "):
  341.             bp[c] = w
  342.             c = c + 1
  343.         w = w + 1
  344.  
  345.     w1 = bp[1] - bp[0] - 1   #width of first letter in ls array
  346.     s1 = bp[0] + 1           #leftmost cell of letter in ls array
  347.     w2 = bp[3] - bp[2] - 1   #width of second letter in ls array
  348.     s2 = bp[2] + 1           #leftmost cell of second letter in ls array
  349.     w3 = bp[5] - bp[4] - 1   #width of third letter in ls array
  350.     s3 = bp[4] + 1           #leftmost cell of third letter in ls array
  351.     w4 = bp[7] - bp[6] - 1   #width of fourth letter in ls array
  352.     s4 = bp[6] + 1           #leftmost cell of fourth letter in ls array
  353.     w5 = bp[9] - bp[8] - 1   #width of fifth letter in ls array
  354.     s5 = bp[8] + 1           #leftmost cell of fifth letter in ls array
  355.  
  356.     o = ""
  357.     i = 0
  358.     e = 0
  359.     while(e<7):
  360.         while(i<w1):
  361.             o = o + ls[e][s1+i]
  362.             i = i + 1
  363.         e = e + 1
  364.         i = 0
  365.     l1 = o
  366.  
  367.     o = ""
  368.     i = 0
  369.     e = 0
  370.     while(e<7):
  371.         while(i<w2):
  372.             o = o + ls[e][s2+i]
  373.             i = i + 1
  374.         e = e + 1
  375.         i = 0
  376.     l2 = o
  377.  
  378.     o = ""
  379.     i = 0
  380.     e = 0
  381.     while(e<7):
  382.         while(i<w3):
  383.             o = o + ls[e][s3+i]
  384.             i = i + 1
  385.         e = e + 1
  386.         i = 0
  387.     l3 = o
  388.  
  389.     o = ""
  390.     i = 0
  391.     e = 0
  392.     while(e<7):
  393.         while(i<w4):
  394.             o = o + ls[e][s4+i]
  395.             i = i + 1
  396.         e = e + 1
  397.         i = 0
  398.     l4 = o
  399.  
  400.     o = ""
  401.     i = 0
  402.     e = 0
  403.     while(e<7):
  404.         while(i<w5):
  405.             o = o + ls[e][s5+i]
  406.             i = i + 1
  407.         e = e + 1
  408.         i = 0
  409.     l5 = o
  410.  
  411.     #match letters with dictionary keys
  412.     y = 0
  413.     while(y<36):
  414.         if(l1 == dictionary[y]):
  415.             l1p = dictionary_key[y]
  416.         y = y + 1
  417.  
  418.     y = 0
  419.     while (y < 36):
  420.        if (l2 == dictionary[y]):
  421.            l2p = dictionary_key[y]
  422.        y = y + 1
  423.  
  424.     y = 0
  425.     while (y < 36):
  426.        if (l3 == dictionary[y]):
  427.            l3p = dictionary_key[y]
  428.        y = y + 1
  429.  
  430.     y = 0
  431.     while (y < 36):
  432.        if (l4 == dictionary[y]):
  433.            l4p = dictionary_key[y]
  434.        y = y + 1
  435.  
  436.     y = 0
  437.     while (y < 36):
  438.        if (l5 == dictionary[y]):
  439.            l5p = dictionary_key[y]
  440.        y = y + 1
  441.     passcode = l1p+l2p+l3p+l4p+l5p
  442.     print(passcode)
  443.  
  444.  
  445. get_page_1()
  446. get_page_2()
  447. get_page_3()
  448. determine_spam()
  449. determine_spam2()
  450. determine_spam3()
  451. print_all_rows()
  452. print("Spam count: ", spam_count, " of ", row_count, " records.")
  453. print("Spam count: ", spam_count2, " of ", row_count2, " records.")
  454. print("Spam count: ", spam_count3, " of ", row_count3, " records.")
  455. bump_thread()
  456.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement