Created
February 15, 2016 19:45
-
-
Save apinela/df72cd6befa833ec7d58 to your computer and use it in GitHub Desktop.
This file contains 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
import java.util.Random; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.openqa.selenium.edge.EdgeDriver; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import com.machinepublishers.jbrowserdriver.JBrowserDriver; | |
import com.machinepublishers.jbrowserdriver.Settings; | |
import com.machinepublishers.jbrowserdriver.Timezone; | |
public class CodeNameSLHackers implements Runnable { | |
public static String URL = "http://www.playbuzz.com/eurosport12/2-11-2016-9-09-18-am"; | |
public static String PROXIES = "107.170.86.187:8123,192.99.54.41:8080,54.152.75.119:80,52.89.116.101:80,192.99.54.110:80,158.69.218.198:8080,158.69.206.63:3128,162.248.243.241:3128,23.226.137.61:3128,192.99.71.135:3128,54.68.135.82:80,45.32.87.149:8080,14.39.140.6:8080,185.128.36.32:80,64.132.113.118:80,210.245.25.226:3128,186.226.190.46:80"; | |
private boolean useProxy; | |
public CodeNameSLHackers(boolean b) { | |
this.useProxy = b; | |
} | |
public static void main(String[] args) throws Exception { | |
ExecutorService executorService = Executors.newFixedThreadPool(Integer.parseInt(args[0])); | |
for (int i = 0; i < Integer.parseInt(args[0]); i++) { | |
executorService.execute(new CodeNameSLHackers((args[1] == "1") ? true : false)); | |
Thread.sleep(1000); | |
} | |
} | |
@Override | |
public void run() { | |
for (;;) { | |
JBrowserDriver driver = new JBrowserDriver(Settings.builder(). | |
timezone(Timezone.EUROPE_LONDON).build()); | |
try { | |
driver.get(URL); | |
driver.findElement(By.cssSelector("span[data-postid='7c03ec4e-5249-4f26-a8bb-b92cf94762d7']")).click(); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} finally { | |
driver.close(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment