def initialize(self, proxies_per_proto={}, user=None, passw=None, debug=False): print 'INIT: TwitterBot' self.__br = Browser() self.__br.set_proxies(proxies_per_proto) self.__br.set_debug_http(debug) self.__debug = debug self.__sandman = SandMan('TwitterBot') self.__ngd = NGD() self.__ngd.set_proxies(proxies_per_proto) self.__lock = Lock() try: # sign in self.__br.open("http://twitter.com/") self.__br.select_form(nr=1) self.__br['session[username_or_email]'] = user self.__br['session[password]'] = passw resp = self.__br.submit() time.sleep(0.2) except Exception, e: if self.__debug: traceback.print_exc(file=sys.stdout) print str(e) print 'EXCEPTION on TwitterBot, possibly bad user/password or https login don\' work behind a proxy.'
def initialize(self, proxies_per_proto={}, user=None, passw=None, debug=False): print 'INIT: SearchEngineBot' self.__br = Browser() self.__br.set_proxies(proxies_per_proto) self.__br.set_debug_http(debug) self.__ngd = NGD(proxies_per_proto) self.__harvest_command = EmailHarvestingCommand() self.__harvest_command.set_only_complete_names(False) self.__sandman = SandMan('SearchEngineBot')
def __init__(self, proxies={}, entropy_filter=True, lang='en', entropy_top=3, query_top=100, fraction=5): self.__ngd = NGD(proxies) #self.__ngd.set_context('site:imsdb.com') self.__cache = {} self.__min_ent = 0.0 self.__entropy_filter = entropy_filter self.__lang = lang self.__entropy_top = entropy_top self.__fraction = fraction self.__query_top = query_top self.__translator = Translate() self.__lock = Lock() self.__voc_translator = None random.seed(666)