Exemplo n.º 1
0
def main(time_frame, max_request_per_time_frame, mongo_coll,search_params, termination_function):
    tcs = TwitterCrawler(time_frame=time_frame,max_requests=max_request_per_time_frame)
    tcs.connect(mongo_coll)
    tcs.authenticate("../api_key.json")
    tcs.set_search_arguments(search_args=search_params)
    tcs.stream_search(delta_t=900, termination_func=termination_function,feedback_time=900)
    tcs.close()
def main(time_frame, max_request_per_time_frame, mongo_coll, search_params,
         max_id, termination_function):
    tcs = TwitterCrawler(time_frame=time_frame,
                         max_requests=max_request_per_time_frame)
    tcs.connect(mongo_coll)
    tcs.authenticate("../api_key.json")
    tcs.set_search_arguments(search_args=search_params)
    tcs.search_by_query(wait_for=3,
                        current_max_id=max_id,
                        term_func=termination_function)
    tcs.close()