Package com.ptaack.seobot.model

Examples of com.ptaack.seobot.model.Proxy


public class SeoBotMethods {

  public static void fetchAnonymProxy() {
    AnonymousProxy anonymProxy = new AnonymousProxy();
    Proxy proxy;
    for(String p: anonymProxy.getList()) {
      proxy = new Proxy(p);
      if (!SeoBotDatabase.isDublicate(proxy)) {
        SeoBotDatabase.addAnonymProxy(proxy);
      }
    }
  }
View Full Code Here


  public static void fakeVisit(String site) {
    HttpClient client = new HttpClient();
    GetMethod method = new GetMethod();
   
    Proxy proxy = (Proxy) SeoBotDatabase.getRandomObject("anonymproxy");
   
    Main.log("Selected proxy: " + proxy.toString());
   
    HostConfiguration hostConf = client.getHostConfiguration();
   
    hostConf.setHost(site);
    hostConf.setProxy(proxy.getIp(), proxy.getPort());
   
    //client.getParams().setSoTimeout(30 * 1000);
    method.getParams().setParameter("http.useragent",SeoBotDatabase.getRandomObject("useragent"));
   
    try {
View Full Code Here

     
      if (table.toLowerCase().equals("anonymproxy"))
        if (rs.getBoolean("dead"))
          getRandomObject(table);
        else
          result = new Proxy(String.format("%s:%d", rs.getString("ip"), rs.getInt("port")));
      else if (table.toLowerCase().equals("useragent"))
        result = rs.getString("uaname");
     
      rs.close();
    } catch (SQLException e) {
View Full Code Here

TOP

Related Classes of com.ptaack.seobot.model.Proxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.