Ejemplo n.º 1
0
    def get_injector_from_file(path: str):
        config = parse_from_file(path)
        injector = Injector(config)

        log_config = config.get("Logging", {})
        LoggerFactory.init_root_logger("snaces2.log")

        return injector
Ejemplo n.º 2
0
def download_local_neighbourhood(name: str, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = DownloadLocalNeighbourhoodActivity(config)
    activity.download_local_neighbourhood_by_screen_name(name)
Ejemplo n.º 3
0
def construct_social_graph(seed_id: str, params=None, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = ConstructSocialGraphActivity(config)
    activity.construct_social_graph(seed_id, params)
def download_local_neighbourhood_tweets(name: str, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = DownloadLocalNeighbourhoodTweetsActivity(config)
    activity.download_local_neighbourhood_tweets_by_user_id(name)
Ejemplo n.º 5
0
def process_tweet(id: str, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = ProcessTweetActivity(config)
    activity.process_tweet_by_id(id)
Ejemplo n.º 6
0
def download_user_tweets(name: str, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = DownloadUserTweetsActivity(config)
    activity.download_user_tweets_by_screen_name(args.name)
Ejemplo n.º 7
0
def download_tweets(num: int, path=DEFAULT_PATH):
    config = parse_from_file(path)

    activity = DownloadTweetsActivity(config)
    activity.stream_random_tweets(num_tweets=num)